changes to be able to specify multiple attributes with keys

This commit is contained in:
Ismael Abreu
2013-02-16 02:06:25 +00:00
parent 1c28577280
commit 2d2094b588
3 changed files with 44 additions and 1 deletions

View File

@@ -69,10 +69,15 @@ module ActiveModel
class << self
# Define attributes to be used in the serialization.
def attributes(*attrs)
self._attributes = _attributes.dup
attrs.each do |attr|
attribute attr
if Hash === attr
attr.each {|attr_real, key| attribute attr_real, :key => key }
else
attribute attr
end
end
end