attribute_method?(attribute) public

Returns true if attribute is an attribute method, false otherwise.

class Person
  include ActiveModel::Validations

  attr_accessor :name
end

User.attribute_method?(:name) # => true
User.attribute_method?(:age)  # => false
Show source
Register or log in to add new notes.