123456789_123456789_123456789_123456789_123456789_

Module: ActiveRecord::AttributeMethods::Query

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Defined in: activerecord/lib/active_record/attribute_methods/query.rb

Class Method Summary

::ActiveSupport::Concern - Extended

class_methods

Define class methods from given block.

included

Evaluate given block in context of base class, so that you can write class macros here.

prepended

Evaluate given block in context of base class, so that you can write class macros here.

Instance Method Summary

DSL Calls

included

[ GitHub ]


9
10
11
# File 'activerecord/lib/active_record/attribute_methods/query.rb', line 9

included do
  attribute_method_suffix "?", parameters: false
end

Instance Method Details

#query_attribute(attr_name) Also known as: #attribute?

[ GitHub ]

  
# File 'activerecord/lib/active_record/attribute_methods/query.rb', line 13

def query_attribute(attr_name)
  value = self.public_send(attr_name)

  query_cast_attribute(attr_name, value)
end