diff options
author | Daniel Colson <danieljamescolson@gmail.com> | 2018-01-21 22:06:59 -0500 |
---|---|---|
committer | Daniel Colson <danieljamescolson@gmail.com> | 2018-01-21 22:06:59 -0500 |
commit | 00de46acf52868d4e0d9fdee58c823c599a275a1 (patch) | |
tree | bd18853b950c24bb5063065fa73830b98501e9f1 /activemodel | |
parent | a19e91f0fab13cca61acdb1f33e27be2323b9786 (diff) | |
download | rails-00de46acf52868d4e0d9fdee58c823c599a275a1.tar.gz rails-00de46acf52868d4e0d9fdee58c823c599a275a1.tar.bz2 rails-00de46acf52868d4e0d9fdee58c823c599a275a1.zip |
Use singular define_attribute_method
`define_attribute_methods` splats the arguments,
then calls out to `define_attribute_method` for
each. When defining a singule attribute, using
the singular version of the method saves us an
array and an extra method call.
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/attributes.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/attributes.rb b/activemodel/lib/active_model/attributes.rb index 28dd24b3cd..046ae67ad7 100644 --- a/activemodel/lib/active_model/attributes.rb +++ b/activemodel/lib/active_model/attributes.rb @@ -23,7 +23,7 @@ module ActiveModel end self.attribute_types = attribute_types.merge(name => type) define_default_attribute(name, options.fetch(:default, NO_DEFAULT_PROVIDED), type) - define_attribute_methods(name) + define_attribute_method(name) end private |