diff options
author | Akira Matsuda <ronnie@dio.jp> | 2016-12-23 15:51:11 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2016-12-24 23:39:36 +0900 |
commit | 5b14129d8d4ad302b4e11df6bd5c7891b75f393c (patch) | |
tree | cfcd0a51846f540f40cc314e29a7070b415a9219 /activerecord/lib/active_record/attribute_methods | |
parent | 6c5bbb4b7d3bdd1b43e512fb6ae764c373c7827b (diff) | |
download | rails-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')
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 |