aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2016-12-23 15:51:11 +0900
committerAkira Matsuda <ronnie@dio.jp>2016-12-24 23:39:36 +0900
commit5b14129d8d4ad302b4e11df6bd5c7891b75f393c (patch)
treecfcd0a51846f540f40cc314e29a7070b415a9219 /activerecord/lib/active_record/attribute_methods
parent6c5bbb4b7d3bdd1b43e512fb6ae764c373c7827b (diff)
downloadrails-5b14129d8d4ad302b4e11df6bd5c7891b75f393c.tar.gz
rails-5b14129d8d4ad302b4e11df6bd5c7891b75f393c.tar.bz2
rails-5b14129d8d4ad302b4e11df6bd5c7891b75f393c.zip
Privatize unneededly protected methods in Active Record
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r--activerecord/lib/active_record/attribute_methods/primary_key.rb4
-rw-r--r--activerecord/lib/active_record/attribute_methods/read.rb4
-rw-r--r--activerecord/lib/active_record/attribute_methods/write.rb4
3 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/primary_key.rb b/activerecord/lib/active_record/attribute_methods/primary_key.rb
index 287367f92a..ffb83a972c 100644
--- a/activerecord/lib/active_record/attribute_methods/primary_key.rb
+++ b/activerecord/lib/active_record/attribute_methods/primary_key.rb
@@ -50,9 +50,9 @@ module ActiveRecord
attribute_in_database(self.class.primary_key)
end
- protected
+ private
- def attribute_method?(attr_name)
+ def attribute_method?(attr_name) # :doc:
attr_name == "id" || super
end
diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb
index 5448ebc165..727b4288e9 100644
--- a/activerecord/lib/active_record/attribute_methods/read.rb
+++ b/activerecord/lib/active_record/attribute_methods/read.rb
@@ -4,7 +4,7 @@ module ActiveRecord
extend ActiveSupport::Concern
module ClassMethods
- protected
+ private
# We want to generate the methods via module_eval rather than
# define_method, because define_method is slower on dispatch.
@@ -24,7 +24,7 @@ module ActiveRecord
# to allocate an object on each call to the attribute method.
# Making it frozen means that it doesn't get duped when used to
# key the @attributes in read_attribute.
- def define_method_attribute(name)
+ def define_method_attribute(name) # :doc:
safe_name = name.unpack("h*".freeze).first
temp_method = "__temp__#{safe_name}"
diff --git a/activerecord/lib/active_record/attribute_methods/write.rb b/activerecord/lib/active_record/attribute_methods/write.rb
index 0022d526a4..a80ee74f47 100644
--- a/activerecord/lib/active_record/attribute_methods/write.rb
+++ b/activerecord/lib/active_record/attribute_methods/write.rb
@@ -8,9 +8,9 @@ module ActiveRecord
end
module ClassMethods
- protected
+ private
- def define_method_attribute=(name)
+ def define_method_attribute=(name) # :doc:
safe_name = name.unpack("h*".freeze).first
ActiveRecord::AttributeMethods::AttrNames.set_name_cache safe_name, name