1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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.
This commit is contained in:
Daniel Colson 2018-01-21 22:06:59 -05:00
parent a19e91f0fa
commit 00de46acf5

View file

@ -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