aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-07-16 08:48:16 +0200
committerYves Senn <yves.senn@gmail.com>2014-07-16 08:48:16 +0200
commit6f15762fa601a5e3238888038684aae7446cfc16 (patch)
treee458f16b8ad43be041b9bb1911571a3475db65e8 /activerecord/lib/active_record/attribute_methods.rb
parent7880f39e1d82cd4faf3dc61928c22b385ced3d50 (diff)
parent9c83e8401d802864dde38ddffb690a4245d01716 (diff)
downloadrails-6f15762fa601a5e3238888038684aae7446cfc16.tar.gz
rails-6f15762fa601a5e3238888038684aae7446cfc16.tar.bz2
rails-6f15762fa601a5e3238888038684aae7446cfc16.zip
Merge pull request #16138 from sgrif/sg-attribute-set-key
AttributeSet#include? -> AttributeSet#key?
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb4
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 cbe5cf202a..1cdb530815 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