instance method
attribute_method?
Ruby on Rails edge
Since v3.0.20Signature
attribute_method?(attribute)
Returns true if attribute is an attribute method, false otherwise.
“‘ class Person
include ActiveModel::Validations
attr_accessor :name
end
Person.attribute_method?(:name) # => true Person.attribute_method?(:age) # => false “‘
Parameters
-
attributereq
Source
# File activemodel/lib/active_model/validations.rb, line 323
def attribute_method?(attribute)
method_defined?(attribute)
end
Defined in activemodel/lib/active_model/validations.rb line 323
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Validations::ClassMethods