aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-06-30 11:43:34 -0600
committerSean Griffin <sean@thoughtbot.com>2014-06-30 11:46:07 -0600
commitb90c85d510f0afe1a132eaaea4f18ca381d84c5f (patch)
tree0768940cfe7450e39c317952a151637926763786 /activerecord
parent58a5c84b09cf5bccccc9000770d108d97a90d099 (diff)
downloadrails-b90c85d510f0afe1a132eaaea4f18ca381d84c5f.tar.gz
rails-b90c85d510f0afe1a132eaaea4f18ca381d84c5f.tar.bz2
rails-b90c85d510f0afe1a132eaaea4f18ca381d84c5f.zip
Don't add a second method for attribute existence
We already had one in the public API that people can use more easily for the transition
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index 75154a7975..e3ac891520 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -202,17 +202,12 @@ module ActiveRecord
if column.nil?
ActiveSupport::Deprecation.warn(<<-MESSAGE.strip_heredoc)
`column_for_attribute` will return a null object for non-existent columns
- in Rails 5.0. Use `attribute_exists?` if you need to check for an
+ in Rails 5.0. Use `has_attribute?` if you need to check for an
attribute's existence.
MESSAGE
end
column
end
-
- # Returns whether or not an attribute exists with the given name.
- def attribute_exists?(name)
- @attributes.include?(name)
- end
end
# A Person object with a name attribute can ask <tt>person.respond_to?(:name)</tt>,