aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/extensions/array.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/extensions/array.rb')
-rw-r--r--lib/arel/extensions/array.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/arel/extensions/array.rb b/lib/arel/extensions/array.rb
new file mode 100644
index 0000000000..793c06aad8
--- /dev/null
+++ b/lib/arel/extensions/array.rb
@@ -0,0 +1,13 @@
+class Array
+ def to_hash
+ Hash[*flatten]
+ end
+
+ def to_sql(formatter = nil)
+ "(" + collect { |e| e.to_sql(formatter) }.join(', ') + ")"
+ end
+
+ def inclusion_predicate_sql
+ "IN"
+ end
+end \ No newline at end of file