method

has_attribute?

has_attribute?(attr_name)
public

Returns true if the given attribute exists, otherwise false.

class Person < ActiveRecord::Base
end

Person.has_attribute?('name')   # => true
Person.has_attribute?(:age)     # => true
Person.has_attribute?(:nothing) # => false