From b90c85d510f0afe1a132eaaea4f18ca381d84c5f Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Mon, 30 Jun 2014 11:43:34 -0600 Subject: 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 --- activerecord/lib/active_record/attribute_methods.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'activerecord/lib') 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 person.respond_to?(:name), -- cgit v1.2.3