Class: ArelExtensions::Nodes::GroupConcat

Inherits:
Function
  • Object
show all
Defined in:
lib/arel_extensions/nodes/concat.rb

Constant Summary collapse

RETURN_TYPE =
:string

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Function

#as, #convert_to_date_node, #convert_to_datetime_node, #convert_to_node, #convert_to_number, #convert_to_string_node, #expr, #left, #return_type, #right, #type_of_attribute

Methods included from Predications

#cast, #convert_to_node, #imatches, #in, #matches, #not_in, #when

Constructor Details

#initialize(expr) ⇒ GroupConcat

Returns a new instance of GroupConcat.



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/arel_extensions/nodes/concat.rb', line 48

def initialize expr
  tab = expr.map { |arg|
    if arg.is_a?(Array)
      @orders = arg
      nil
    else
      convert_to_node(arg)
    end
  }.compact
  super(tab)
end

Instance Attribute Details

#ordersObject

Returns the value of attribute orders.



46
47
48
# File 'lib/arel_extensions/nodes/concat.rb', line 46

def orders
  @orders
end