diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-07-11 07:50:16 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-07-11 07:50:16 -0600 |
commit | 9c83e8401d802864dde38ddffb690a4245d01716 (patch) | |
tree | 8b6115712303cb5529337568c8110b71abce04ac /activerecord/lib/active_record/attribute_methods.rb | |
parent | fe6715ea0d6c4ecc6e9f02062889cf2ad998b2b4 (diff) | |
download | rails-9c83e8401d802864dde38ddffb690a4245d01716.tar.gz rails-9c83e8401d802864dde38ddffb690a4245d01716.tar.bz2 rails-9c83e8401d802864dde38ddffb690a4245d01716.zip |
AttributeSet#include? -> AttributeSet#key?
https://github.com/rails/rails/pull/15868/files#r14135210
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index e3ac891520..d728fb5ddf 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -251,7 +251,7 @@ module ActiveRecord # person.has_attribute?('age') # => true # person.has_attribute?(:nothing) # => false def has_attribute?(attr_name) - @attributes.include?(attr_name.to_s) + @attributes.key?(attr_name.to_s) end # Returns an array of names for the attributes available on this object. @@ -386,7 +386,7 @@ module ActiveRecord def attribute_method?(attr_name) # :nodoc: # We check defined? because Syck calls respond_to? before actually calling initialize. - defined?(@attributes) && @attributes.include?(attr_name) + defined?(@attributes) && @attributes.key?(attr_name) end private |