Class: ActiveRecord::Relation::QueryAttribute

Inherits:
Attribute
  • Object
show all
Defined in:
lib/active_record/relation/query_attribute.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Attribute

#name, #type, #value_before_type_cast

Instance Method Summary collapse

Methods inherited from Attribute

#==, #came_from_user?, #changed?, #changed_in_place?, #encode_with, #forgetting_assignment, from_database, from_user, #has_been_read?, #hash, #init_with, #initialize, #initialized?, null, #original_value, uninitialized, #value, with_cast_value, #with_type, #with_value_from_database, #with_value_from_user

Constructor Details

This class inherits a constructor from ActiveRecord::Attribute

Instance Method Details

#type_cast(value) ⇒ Object



6
7
8
# File 'lib/active_record/relation/query_attribute.rb', line 6

def type_cast(value)
  value
end

#value_for_databaseObject



10
11
12
# File 'lib/active_record/relation/query_attribute.rb', line 10

def value_for_database
  @value_for_database ||= super
end

#with_cast_value(value) ⇒ Object



14
15
16
# File 'lib/active_record/relation/query_attribute.rb', line 14

def with_cast_value(value)
  QueryAttribute.new(name, value, type)
end