method
attribute_method?
v7.1.3.2 -
Show latest stable
- Class:
ActiveRecord::AttributeMethods::ClassMethods
attribute_method?(attribute)public
Returns true if attribute is an attribute method and table exists, false otherwise.
class Person < ActiveRecord::Base end Person.attribute_method?('name') # => true Person.attribute_method?(:age=) # => true Person.attribute_method?(:nothing) # => false