lib/appfuel/storage/repository/mapper.rb in appfuel-0.3.2 vs lib/appfuel/storage/repository/mapper.rb in appfuel-0.3.3
- old
+ new
@@ -149,9 +149,14 @@
end
entity_attrs
end
+ def storage_hash(storage)
+ return storage if storage.is_a?(Hash)
+ fail "storage must implement to_h" unless storage.respond_to?(:to_h)
+ storage.to_h
+ end
# Convert the domain into a hash of storage attributes that represent.
# Each storage class has its own hash of mapped attributes. A domain
# can have more than one storage class.
#
# @param domain [Appfuel::Domain::Entity]