Class: Squeel::Nodes::Join

Inherits:
Object
  • Object
show all
Defined in:
lib/squeel/nodes/join.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#klassObject

Returns the value of attribute klass.



4
5
6
# File 'lib/squeel/nodes/join.rb', line 4

def klass
  @klass
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/squeel/nodes/join.rb', line 4

def name
  @name
end

#typeObject (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

#innerObject



11
12
13
14
# File 'lib/squeel/nodes/join.rb', line 11

def inner
  @type = Arel::InnerJoin
  self
end

#outerObject



16
17
18
19
# File 'lib/squeel/nodes/join.rb', line 16

def outer
  @type = Arel::OuterJoin
  self
end

#polymorphic?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/squeel/nodes/join.rb', line 25

def polymorphic?
  @klass
end

#to_symObject

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