aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel/visitors/mysql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/arel/visitors/mysql.rb')
-rw-r--r--activerecord/lib/arel/visitors/mysql.rb22
1 files changed, 13 insertions, 9 deletions
diff --git a/activerecord/lib/arel/visitors/mysql.rb b/activerecord/lib/arel/visitors/mysql.rb
index ee75b6bb25..0f7d5aa803 100644
--- a/activerecord/lib/arel/visitors/mysql.rb
+++ b/activerecord/lib/arel/visitors/mysql.rb
@@ -65,6 +65,19 @@ module Arel # :nodoc: all
collector = inject_join o.values, collector, ", "
end
+ collect_where_for(o, collector)
+ end
+
+ def visit_Arel_Nodes_Concat(o, collector)
+ collector << " CONCAT("
+ visit o.left, collector
+ collector << ", "
+ visit o.right, collector
+ collector << ") "
+ collector
+ end
+
+ def collect_where_for(o, collector)
unless o.wheres.empty?
collector << " WHERE "
collector = inject_join o.wheres, collector, " AND "
@@ -77,15 +90,6 @@ module Arel # :nodoc: all
maybe_visit o.limit, collector
end
-
- def visit_Arel_Nodes_Concat(o, collector)
- collector << " CONCAT("
- visit o.left, collector
- collector << ", "
- visit o.right, collector
- collector << ") "
- collector
- end
end
end
end