diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-30 14:55:52 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-30 14:55:52 -0300 |
commit | 66d6c875baae1804d0a440b99705754143bfff99 (patch) | |
tree | 0768940cfe7450e39c317952a151637926763786 | |
parent | 58a5c84b09cf5bccccc9000770d108d97a90d099 (diff) | |
parent | b90c85d510f0afe1a132eaaea4f18ca381d84c5f (diff) | |
download | rails-66d6c875baae1804d0a440b99705754143bfff99.tar.gz rails-66d6c875baae1804d0a440b99705754143bfff99.tar.bz2 rails-66d6c875baae1804d0a440b99705754143bfff99.zip |
Merge pull request #15991 from sgrif/sg-has-attribute
Don't add a second method for attribute existence
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 7 |
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>, |