aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/engines/sql/core_extensions/array.rb
diff options
context:
space:
mode:
authorBryan Helmkamp <bryan@brynary.com>2009-09-30 23:23:46 -0400
committerBryan Helmkamp <bryan@brynary.com>2009-09-30 23:23:46 -0400
commit52e8aff146c162986566d3e03852395729d7c24d (patch)
tree1d04e0a73a88b0bf5e091f26ce7ba8c353aeb37d /lib/arel/engines/sql/core_extensions/array.rb
parent836a57732c6ddd3842f1bf50e687049a098f7383 (diff)
downloadrails-52e8aff146c162986566d3e03852395729d7c24d.tar.gz
rails-52e8aff146c162986566d3e03852395729d7c24d.tar.bz2
rails-52e8aff146c162986566d3e03852395729d7c24d.zip
Move extensions directories to core_extensions
Diffstat (limited to 'lib/arel/engines/sql/core_extensions/array.rb')
-rw-r--r--lib/arel/engines/sql/core_extensions/array.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/arel/engines/sql/core_extensions/array.rb b/lib/arel/engines/sql/core_extensions/array.rb
new file mode 100644
index 0000000000..80041cb5f3
--- /dev/null
+++ b/lib/arel/engines/sql/core_extensions/array.rb
@@ -0,0 +1,16 @@
+module Arel
+ module Sql
+ module ArrayExtensions
+ def to_sql(formatter = nil)
+ "(" + collect { |e| e.to_sql(formatter) }.join(', ') + ")"
+ end
+
+ def inclusion_predicate_sql
+ "IN"
+ end
+
+ Array.send(:include, self)
+ end
+ end
+end
+