mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
avoice paying hash cost if there are no serialized attributes
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user