1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

fix select/reject vs lazy_loading weirdness

This commit is contained in:
geemus (Wesley Beary) 2010-02-27 13:05:09 -08:00
parent e53d9d34d9
commit 1052ce9c65

View file

@ -10,11 +10,11 @@ module Fog
RUBY
end
%w[collect map reject select].each do |method|
%w[reject select].each do |method|
class_eval <<-RUBY
def #{method}(*args)
lazy_load
self.class.new({}).concat(super)
self.class.new(:connection => self.connection).load(super)
end
RUBY
end
@ -101,6 +101,11 @@ module Fog
data
end
def load(array)
@loaded = true
self.clear.concat(array)
end
def model
self.class.instance_variable_get('@model')
end