lib/fog/model.rb in fog-0.0.91 vs lib/fog/model.rb in fog-0.0.92
- old
+ new
@@ -89,12 +89,12 @@
def reload
if data = collection.get(identity)
new_attributes = data.attributes
merge_attributes(new_attributes)
+ self
end
- self
end
def requires(*args)
missing = []
for arg in [:connection] | args
@@ -113,10 +113,13 @@
attributes.to_json
end
def wait_for(timeout = 600, &block)
reload
- Fog.wait_for(timeout) { reload && instance_eval(&block) }
+ Fog.wait_for(timeout) do
+ reload or raise StandardError.new("Reload failed, #{self.class} #{self.identity} went away.")
+ instance_eval(&block)
+ end
end
private
def collection=(new_collection)