From 00de46acf52868d4e0d9fdee58c823c599a275a1 Mon Sep 17 00:00:00 2001 From: Daniel Colson Date: Sun, 21 Jan 2018 22:06:59 -0500 Subject: 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. --- activemodel/lib/active_model/attributes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activemodel/lib/active_model/attributes.rb') 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 -- cgit v1.2.3