Class: Arel::Attributes::Relation
- Inherits:
-
Attribute
- Object
- Attribute
- Arel::Attributes::Relation
- Defined in:
- lib/arel/nodes/relation.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
-
#for_write ⇒ Object
Returns the value of attribute for_write.
Instance Method Summary collapse
- #able_to_type_cast? ⇒ Boolean
- #eql?(other) ⇒ Boolean
-
#initialize(relation, name, collection = false, for_write = false) ⇒ Relation
constructor
A new instance of Relation.
- #table_name ⇒ Object
- #type_cast_for_database(value) ⇒ Object
Constructor Details
#initialize(relation, name, collection = false, for_write = false) ⇒ Relation
Returns a new instance of Relation.
7 8 9 10 11 12 |
# File 'lib/arel/nodes/relation.rb', line 7 def initialize(relation, name, collection = false, for_write=false) self[:relation] = relation self[:name] = name @collection = collection @for_write = for_write end |
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
5 6 7 |
# File 'lib/arel/nodes/relation.rb', line 5 def collection @collection end |
#for_write ⇒ Object
Returns the value of attribute for_write.
5 6 7 |
# File 'lib/arel/nodes/relation.rb', line 5 def for_write @for_write end |
Instance Method Details
#able_to_type_cast? ⇒ Boolean
14 15 16 |
# File 'lib/arel/nodes/relation.rb', line 14 def able_to_type_cast? relation.able_to_type_cast? end |
#eql?(other) ⇒ Boolean
22 23 24 25 26 27 |
# File 'lib/arel/nodes/relation.rb', line 22 def eql? other self.class == other.class && self.relation == other.relation && self.name == other.name && self.collection == other.collection end |
#table_name ⇒ Object
18 19 20 |
# File 'lib/arel/nodes/relation.rb', line 18 def table_name nil end |
#type_cast_for_database(value) ⇒ Object
29 30 31 |
# File 'lib/arel/nodes/relation.rb', line 29 def type_cast_for_database(value) relation.type_cast_for_database(value) end |