aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/where_sql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/visitors/where_sql.rb')
-rw-r--r--lib/arel/visitors/where_sql.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/arel/visitors/where_sql.rb b/lib/arel/visitors/where_sql.rb
new file mode 100644
index 0000000000..9816fa7a70
--- /dev/null
+++ b/lib/arel/visitors/where_sql.rb
@@ -0,0 +1,9 @@
+module Arel
+ module Visitors
+ class WhereSql < Arel::Visitors::ToSql
+ def visit_Arel_Nodes_SelectCore o
+ "WHERE #{o.wheres.map { |x| visit x }.join ' AND ' }"
+ end
+ end
+ end
+end