has_attribute?(attr_name)
Instance Public methods
Returns true
if the given attribute is in the attributes hash,
otherwise false
.
class Person < ActiveRecord::Base end person = Person.new person.has_attribute?(:name) # => true person.has_attribute?('age') # => true person.has_attribute?(:nothing) # => false
Please login to continue.