Class: ActiveRecordExtended::QueryMethods::Unionize::UnionChain
Constant Summary
Utilities::Support::A_TO_Z_KEYS
Instance Method Summary
collapse
#inline_order_by, #order_by_expression, #process_ordering_arguments!, #scope_preprocess_order_args, #to_ordered_table_path
#double_quote, #flatten_safely, #flatten_to_sql, #from_clause_constructor, #generate_grouping, #generate_named_function, #group_when_needed, #key_generator, #literal_key, #needs_to_be_grouped?, #nested_alias_escape, #pipe_cte_with!, #to_arel_sql, #wrap_with_agg_array, #wrap_with_array
Constructor Details
#initialize(scope) ⇒ UnionChain
Returns a new instance of UnionChain.
14
15
16
|
# File 'lib/active_record_extended/query_methods/unionize.rb', line 14
def initialize(scope)
@scope = scope
end
|
Instance Method Details
#all(*args) ⇒ Object
Also known as:
union_all
42
43
44
45
|
# File 'lib/active_record_extended/query_methods/unionize.rb', line 42
def all(*args)
append_union_order!(:union_all, args)
@scope
end
|
#as(from_clause_name) ⇒ Object
Also known as:
union_as
18
19
20
21
|
# File 'lib/active_record_extended/query_methods/unionize.rb', line 18
def as(from_clause_name)
@scope.unionized_name = from_clause_name.to_s
@scope
end
|
#except(*args) ⇒ Object
Also known as:
union_except
48
49
50
51
|
# File 'lib/active_record_extended/query_methods/unionize.rb', line 48
def except(*args)
append_union_order!(:except, args)
@scope
end
|
#intersect(*args) ⇒ Object
Also known as:
union_intersect
54
55
56
57
|
# File 'lib/active_record_extended/query_methods/unionize.rb', line 54
def intersect(*args)
append_union_order!(:intersect, args)
@scope
end
|
#order(*ordering_args) ⇒ Object
Also known as:
order_union
24
25
26
27
28
|
# File 'lib/active_record_extended/query_methods/unionize.rb', line 24
def order(*ordering_args)
process_ordering_arguments!(ordering_args)
@scope.union_ordering_values += ordering_args
@scope
end
|
#reorder(*ordering_args) ⇒ Object
Also known as:
reorder_union
31
32
33
34
|
# File 'lib/active_record_extended/query_methods/unionize.rb', line 31
def reorder(*ordering_args)
@scope.union_ordering_values.clear
order(*ordering_args)
end
|
#union(*args) ⇒ Object
37
38
39
40
|
# File 'lib/active_record_extended/query_methods/unionize.rb', line 37
def union(*args)
append_union_order!(:union, args)
@scope
end
|