diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-12-28 21:53:51 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-12-28 21:53:51 -0500 |
commit | 010e246756c09f44e901f4fd8e8eab2cb3022e95 (patch) | |
tree | de880274810f885232ac51bbf529bab0366eca45 /activerecord/lib/active_record/attribute_methods | |
parent | 09cdf425d70cfec541e0008c28055155d70c6f37 (diff) | |
download | rails-010e246756c09f44e901f4fd8e8eab2cb3022e95.tar.gz rails-010e246756c09f44e901f4fd8e8eab2cb3022e95.tar.bz2 rails-010e246756c09f44e901f4fd8e8eab2cb3022e95.zip |
Fix Rubocop violations and fix documentation visibility
Some methods were added to public API in
5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of
the public API.
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
3 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/primary_key.rb b/activerecord/lib/active_record/attribute_methods/primary_key.rb index ffb83a972c..8fcac82a0d 100644 --- a/activerecord/lib/active_record/attribute_methods/primary_key.rb +++ b/activerecord/lib/active_record/attribute_methods/primary_key.rb @@ -52,7 +52,7 @@ module ActiveRecord private - def attribute_method?(attr_name) # :doc: + def attribute_method?(attr_name) 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 727b4288e9..369a6e35aa 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -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) # :doc: + def define_method_attribute(name) 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 a80ee74f47..fe0e01db28 100644 --- a/activerecord/lib/active_record/attribute_methods/write.rb +++ b/activerecord/lib/active_record/attribute_methods/write.rb @@ -10,7 +10,7 @@ module ActiveRecord module ClassMethods private - def define_method_attribute=(name) # :doc: + def define_method_attribute=(name) safe_name = name.unpack("h*".freeze).first ActiveRecord::AttributeMethods::AttrNames.set_name_cache safe_name, name |