avoice paying hash cost if there are no serialized attributes

This commit is contained in:
Aaron Patterson
2011-06-27 17:46:56 -07:00
parent 45b7209f1f
commit 9152126110

View File

@@ -1893,9 +1893,10 @@ MSG
private
def set_serialized_attributes
(@attributes.keys & self.class.serialized_attributes.keys).each do |key|
coder = self.class.serialized_attributes[key]
@attributes[key] = coder.load @attributes[key]
sattrs = self.class.serialized_attributes
sattrs.each do |key, coder|
@attributes[key] = coder.load @attributes[key] if @attributes.key?(key)
end
end