mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-19 05:16:39 +00:00
finalized lazy-loading work on Finder
This commit is contained in:
@@ -49,6 +49,10 @@ module Redistat
|
||||
@result ||= find
|
||||
end
|
||||
|
||||
def total
|
||||
all.total
|
||||
end
|
||||
|
||||
def each(&block)
|
||||
all.each(&block)
|
||||
end
|
||||
@@ -61,10 +65,6 @@ module Redistat
|
||||
all.each_with_index(&block)
|
||||
end
|
||||
|
||||
def reset!
|
||||
@result = nil
|
||||
end
|
||||
|
||||
def connection_ref(ref)
|
||||
reset! if @options[:connection_ref] != ref
|
||||
@options[:connection_ref] = ref
|
||||
@@ -168,9 +168,9 @@ module Redistat
|
||||
end
|
||||
col
|
||||
end
|
||||
|
||||
def db
|
||||
super(@options[:connection_ref])
|
||||
|
||||
def reset!
|
||||
@result = nil
|
||||
end
|
||||
|
||||
def valid_options?
|
||||
@@ -204,5 +204,9 @@ module Redistat
|
||||
sum
|
||||
end
|
||||
|
||||
def db
|
||||
super(@options[:connection_ref])
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user