method
has_attribute?
rails latest stable - Class:
ActiveRecord::AttributeMethods
has_attribute?(attr_name)public
Returns true if the given attribute is in the attributes hash, otherwise false.
class Person < ActiveRecord::Base alias_attribute :new_name, :name end person = Person.new person.has_attribute?(:name) # => true person.has_attribute?(:new_name) # => true person.has_attribute?('age') # => true person.has_attribute?(:nothing) # => false