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:
parent
a19e91f0fa
commit
00de46acf5
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue