aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorMarcin Olichwirowicz <olichwirowicz@gmail.com>2015-08-12 00:23:12 +0200
committerMarcin Olichwirowicz <olichwirowicz@gmail.com>2015-08-12 00:23:12 +0200
commit3c6fc5892f7fa1ab5044667d1b4c8a8c34db89ea (patch)
treeafab63010d8f98d61157dc964672e38951d1c33f /activemodel
parent41e7923cd4d27887d6abb7ace272ea0c6d6b65b1 (diff)
downloadrails-3c6fc5892f7fa1ab5044667d1b4c8a8c34db89ea.tar.gz
rails-3c6fc5892f7fa1ab5044667d1b4c8a8c34db89ea.tar.bz2
rails-3c6fc5892f7fa1ab5044667d1b4c8a8c34db89ea.zip
Rename match_attribute_method? to matched_attribute_method
`match_attribute_method?` is a bit confusing because it suggest that a return value is a boolean which is not true.
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/attribute_methods.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb
index 9033ec0dca..77e4ce3afe 100644
--- a/activemodel/lib/active_model/attribute_methods.rb
+++ b/activemodel/lib/active_model/attribute_methods.rb
@@ -342,7 +342,7 @@ module ActiveModel
private
# The methods +method_missing+ and +respond_to?+ of this module are
# invoked often in a typical rails, both of which invoke the method
- # +match_attribute_method?+. The latter method iterates through an
+ # +matched_attribute_method+. The latter method iterates through an
# array doing regular expression matches, which results in a lot of
# object creations. Most of the time it returns a +nil+ match. As the
# match result is always the same given a +method_name+, this cache is
@@ -429,7 +429,7 @@ module ActiveModel
if respond_to_without_attributes?(method, true)
super
else
- match = match_attribute_method?(method.to_s)
+ match = matched_attribute_method(method.to_s)
match ? attribute_missing(match, *args, &block) : super
end
end
@@ -454,7 +454,7 @@ module ActiveModel
# but found among all methods. Which means that the given method is private.
false
else
- !match_attribute_method?(method.to_s).nil?
+ !matched_attribute_method(method.to_s).nil?
end
end
@@ -466,7 +466,7 @@ module ActiveModel
private
# Returns a struct representing the matching attribute method.
# The struct's attributes are prefix, base and suffix.
- def match_attribute_method?(method_name)
+ def matched_attribute_method(method_name)
matches = self.class.send(:attribute_method_matchers_matching, method_name)
matches.detect { |match| attribute_method?(match.attr_name) }
end