instance method
define_question_method
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18 PrivateAvailable in: v2.2.3 v2.3.18
Signature
define_question_method(attr_name)
Defines a predicate method attr_name?.
Parameters
-
attr_namereq
Source
# File activerecord/lib/active_record/attribute_methods.rb, line 180
def define_question_method(attr_name)
evaluate_attribute_method attr_name, "def #{attr_name}?; query_attribute('#{attr_name}'); end", "#{attr_name}?"
end
Defined in activerecord/lib/active_record/attribute_methods.rb line 180
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AttributeMethods::ClassMethods