Merge pull request #268 from vanstee/escape-attribute-names

Support "unsymbolizable" strings as attribute names
This commit is contained in:
Steve Klabnik
2013-04-15 17:25:24 -07:00
3 changed files with 20 additions and 1 deletions

View File

@@ -451,7 +451,7 @@ module ActiveModel
method << " h = {}\n"
_attributes.each do |name,key|
method << " h[:#{key}] = read_attribute_for_serialization(:#{name}) if send #{INCLUDE_METHODS[name].inspect}\n"
method << " h[:\"#{key}\"] = read_attribute_for_serialization(:\"#{name}\") if send #{INCLUDE_METHODS[name].inspect}\n"
end
method << " h\nend"