aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/attribute_methods.rb
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2016-12-19 18:41:09 +0900
committerAkira Matsuda <ronnie@dio.jp>2016-12-24 12:18:16 +0900
commitcdb9d7f481a6b299cd53a0f647397da60d806a21 (patch)
tree44159052e42e6add9ed5f74870df8fbcc027caa8 /activemodel/lib/active_model/attribute_methods.rb
parent53f537d1f83e48aa72ea9ecbf23cc3c7302758a6 (diff)
downloadrails-cdb9d7f481a6b299cd53a0f647397da60d806a21.tar.gz
rails-cdb9d7f481a6b299cd53a0f647397da60d806a21.tar.bz2
rails-cdb9d7f481a6b299cd53a0f647397da60d806a21.zip
Privatize unneededly protected methods in Active Model
Diffstat (limited to 'activemodel/lib/active_model/attribute_methods.rb')
-rw-r--r--activemodel/lib/active_model/attribute_methods.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb
index f1aff25fe9..09825cf861 100644
--- a/activemodel/lib/active_model/attribute_methods.rb
+++ b/activemodel/lib/active_model/attribute_methods.rb
@@ -334,12 +334,11 @@ module ActiveModel
}.tap { |mod| include mod }
end
- protected
- def instance_method_already_implemented?(method_name) #:nodoc:
+ private
+ def instance_method_already_implemented?(method_name)
generated_attribute_methods.method_defined?(method_name)
end
- private
# The methods +method_missing+ and +respond_to?+ of this module are
# invoked often in a typical rails, both of which invoke the method
# +matched_attribute_method+. The latter method iterates through an
@@ -458,12 +457,11 @@ module ActiveModel
end
end
- protected
- def attribute_method?(attr_name) #:nodoc:
+ private
+ def attribute_method?(attr_name)
respond_to_without_attributes?(:attributes) && attributes.include?(attr_name)
end
- private
# Returns a struct representing the matching attribute method.
# The struct's attributes are prefix, base and suffix.
def matched_attribute_method(method_name)