finalized lazy-loading work on Finder

This commit is contained in:
2011-03-09 01:25:02 +00:00
parent 7e8e1dacc7
commit 33e9477552
2 changed files with 71 additions and 31 deletions

View File

@@ -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