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

load items on map/each if they are not already loaded.

This gets rid of ugly things like collection.each { |item| item.reload; ... do something .. }
This commit is contained in:
freeformz 2010-06-16 08:17:05 +08:00 committed by Wesley Beary
parent b31f8b7201
commit 60cff85fb4

View file

@ -65,7 +65,14 @@ module Fog
def each
super do |item|
item.reload
item.reload unless item.loaded?
yield(item)
end
end
def map
super do |item|
item.reload unless item.loaded?
yield(item)
end
end