Class: Arel::Nodes::Grouping

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/virtual_attributes/virtual_arel.rb

Overview

in essence, this is our Arel::Nodes::VirtualAttribute

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name.



15
16
17
# File 'lib/active_record/virtual_attributes/virtual_arel.rb', line 15

def name
  @name
end

#relationObject

Returns the value of attribute relation.



15
16
17
# File 'lib/active_record/virtual_attributes/virtual_arel.rb', line 15

def relation
  @relation
end

Instance Method Details

#able_to_type_cast?Boolean

rubocop:disable Rails/Delegate

Returns:

  • (Boolean)


32
33
34
# File 'lib/active_record/virtual_attributes/virtual_arel.rb', line 32

def able_to_type_cast?
  relation.able_to_type_cast?
end

#lowerObject

Create a node for lowering this attribute



23
24
25
# File 'lib/active_record/virtual_attributes/virtual_arel.rb', line 23

def lower
  relation.lower(self)
end

#type_cast_for_database(value) ⇒ Object



27
28
29
# File 'lib/active_record/virtual_attributes/virtual_arel.rb', line 27

def type_cast_for_database(value)
  relation.type_cast_for_database(name, value)
end

#type_casterObject

methods from Arel::Nodes::Attribute



18
19
20
# File 'lib/active_record/virtual_attributes/virtual_arel.rb', line 18

def type_caster
  relation.type_for_attribute(name)
end