Class: Squeel::Nodes::Join
- Inherits:
-
Object
- Object
- Squeel::Nodes::Join
- Defined in:
- lib/squeel/nodes/join.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type = Arel::InnerJoin, klass = nil) ⇒ Join
constructor
A new instance of Join.
- #inner ⇒ Object
- #outer ⇒ Object
- #polymorphic? ⇒ Boolean
-
#to_sym ⇒ Object
expand_hash_conditions_for_aggregates assumes our hash keys can be converted to symbols, so this has to be implemented, but it doesn’t really have to do anything useful.
Constructor Details
#initialize(name, type = Arel::InnerJoin, klass = nil) ⇒ Join
Returns a new instance of Join.
6 7 8 9 |
# File 'lib/squeel/nodes/join.rb', line 6 def initialize(name, type = Arel::InnerJoin, klass = nil) @name, @type = name, type @klass = convert_to_class(klass) if klass end |
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
4 5 6 |
# File 'lib/squeel/nodes/join.rb', line 4 def klass @klass end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/squeel/nodes/join.rb', line 4 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/squeel/nodes/join.rb', line 4 def type @type end |
Instance Method Details
#inner ⇒ Object
11 12 13 14 |
# File 'lib/squeel/nodes/join.rb', line 11 def inner @type = Arel::InnerJoin self end |
#outer ⇒ Object
16 17 18 19 |
# File 'lib/squeel/nodes/join.rb', line 16 def outer @type = Arel::OuterJoin self end |
#polymorphic? ⇒ Boolean
25 26 27 |
# File 'lib/squeel/nodes/join.rb', line 25 def polymorphic? @klass end |
#to_sym ⇒ Object
expand_hash_conditions_for_aggregates assumes our hash keys can be converted to symbols, so this has to be implemented, but it doesn’t really have to do anything useful.
32 33 34 |
# File 'lib/squeel/nodes/join.rb', line 32 def to_sym nil end |