25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/active_record/collections/collectable.rb', line 25
def collection
kollektion.from_hash({
klass: klass,
select: select_values,
distinct: distinct_value,
joins: joins_values,
references: references_values,
includes: includes_values,
where: where_values.map { |v| v.is_a?(String) ? v : v.to_sql },
group: group_values.map { |v| (v.is_a?(String) || v.is_a?(Symbol)) ? v : v.to_sql },
order: order_values.map { |v| (v.is_a?(String) || v.is_a?(Symbol)) ? v : v.to_sql },
bind: bind_values.map { |b| {name: b.first.name, value: b.last} },
limit: limit_value,
offset: offset_value
})
end
|