aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_relation/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/active_relation/extensions')
-rw-r--r--lib/active_relation/extensions/array.rb4
-rw-r--r--lib/active_relation/extensions/hash.rb8
2 files changed, 2 insertions, 10 deletions
diff --git a/lib/active_relation/extensions/array.rb b/lib/active_relation/extensions/array.rb
index 5e2981a4c5..c07819d35f 100644
--- a/lib/active_relation/extensions/array.rb
+++ b/lib/active_relation/extensions/array.rb
@@ -3,7 +3,7 @@ class Array
Hash[*flatten]
end
- def to_sql(formatter = Sql::SelectExpression.new)
- formatter.array self
+ def to_sql(formatter = nil)
+ "(" + collect { |e| e.to_sql(formatter) }.join(', ') + ")"
end
end \ No newline at end of file
diff --git a/lib/active_relation/extensions/hash.rb b/lib/active_relation/extensions/hash.rb
index 133eab1026..a33ace5738 100644
--- a/lib/active_relation/extensions/hash.rb
+++ b/lib/active_relation/extensions/hash.rb
@@ -8,12 +8,4 @@ class Hash
descendent.merge(yield(key) => yield(value))
end
end
-
- def to_sql(formatter = nil)
- '(' +
- inject([]) do |values, (key, value)|
- values << key.format(value)
- end.join(', ') +
- ')'
- end
end \ No newline at end of file