Module: ActiveRecord::AttributeMethods::Query

Extended by:
ActiveSupport::Concern
Defined in:
lib/active_record/attribute_methods/query.rb

Overview

Active Record Attribute Methods Query

Instance Method Summary collapse

Instance Method Details

#_query_attribute(attr_name) ⇒ Object

:nodoc:



19
20
21
22
23
# File 'lib/active_record/attribute_methods/query.rb', line 19

def _query_attribute(attr_name) # :nodoc:
  value = self._read_attribute(attr_name.to_s)

  query_cast_attribute(attr_name, value)
end

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



13
14
15
16
17
# File '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