diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-02-23 11:10:51 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-02-23 11:10:51 +0900 |
commit | 6d63b5e49a399fe246afcebad45c3c962de268fa (patch) | |
tree | 029d62a7f20e425efd8dedabe4beeeae05a038b8 /activerecord/lib/active_record/attribute_methods.rb | |
parent | cf629f6d2901615062a39723f442e604937bed24 (diff) | |
download | rails-6d63b5e49a399fe246afcebad45c3c962de268fa.tar.gz rails-6d63b5e49a399fe246afcebad45c3c962de268fa.tar.bz2 rails-6d63b5e49a399fe246afcebad45c3c962de268fa.zip |
Use private attr_reader
Since #32028, Rails 6 requires Ruby 2.3+.
No longer needed workaround for Ruby 2.2 "private attribute?" warning.
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index c77790dc9a..842f407517 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -432,15 +432,12 @@ module ActiveRecord @attributes.accessed end - protected - - def attribute_method?(attr_name) # :nodoc: + private + def attribute_method?(attr_name) # We check defined? because Syck calls respond_to? before actually calling initialize. defined?(@attributes) && @attributes.key?(attr_name) end - private - def arel_attributes_with_values_for_create(attribute_names) arel_attributes_with_values(attributes_for_create(attribute_names)) end |