diff options
Diffstat (limited to 'lib/arel/engines/sql')
-rw-r--r-- | lib/arel/engines/sql/relations/relation.rb | 4 | ||||
-rw-r--r-- | lib/arel/engines/sql/relations/writes.rb | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/arel/engines/sql/relations/relation.rb b/lib/arel/engines/sql/relations/relation.rb index 940f985358..78508595fd 100644 --- a/lib/arel/engines/sql/relations/relation.rb +++ b/lib/arel/engines/sql/relations/relation.rb @@ -15,7 +15,7 @@ module Arel "SELECT #{select_clauses.kind_of?(::Array) ? select_clauses.join("") : select_clauses.to_s}", "FROM #{from_clauses}", (joins(self) unless joins(self).blank? ), - ("WHERE #{where_clauses.join("\n\tAND ")}" unless wheres.blank? ), + ("WHERE #{where_clauses.join(" AND ")}" unless wheres.blank? ), ("GROUP BY #{group_clauses.join(', ')}" unless groupings.blank? ), ("HAVING #{having_clauses.join(', ')}" unless havings.blank? ), ("#{locked}" unless locked.blank? ) @@ -31,7 +31,7 @@ module Arel "SELECT #{select_clauses.join(', ')}", "FROM #{from_clauses}", (joins(self) unless joins(self).blank? ), - ("WHERE #{where_clauses.join("\n\tAND ")}" unless wheres.blank? ), + ("WHERE #{where_clauses.join(" AND ")}" unless wheres.blank? ), ("GROUP BY #{group_clauses.join(', ')}" unless groupings.blank? ), ("HAVING #{having_clauses.join(', ')}" unless havings.blank? ), ("ORDER BY #{order_clauses.join(', ')}" unless orders.blank? ), diff --git a/lib/arel/engines/sql/relations/writes.rb b/lib/arel/engines/sql/relations/writes.rb index 50fcb8e07e..83c5fbad42 100644 --- a/lib/arel/engines/sql/relations/writes.rb +++ b/lib/arel/engines/sql/relations/writes.rb @@ -4,7 +4,7 @@ module Arel build_query \ "DELETE", "FROM #{table_sql}", - ("WHERE #{wheres.collect(&:to_sql).join('\n\tAND ')}" unless wheres.blank? ), + ("WHERE #{wheres.collect(&:to_sql).join(' AND ')}" unless wheres.blank? ), ("LIMIT #{taken}" unless taken.blank? ) end end @@ -55,7 +55,7 @@ module Arel attributes.map do |attribute| value = assignments[attribute] "#{engine.quote_column_name(attribute.name)} = #{attribute.format(value)}" - end.join(",\n") + end.join(", ") else assignments.value end @@ -63,7 +63,7 @@ module Arel def build_update_conditions_sql conditions = "" - conditions << " WHERE #{wheres.collect(&:to_sql).join('\n\tAND ')}" unless wheres.blank? + conditions << " WHERE #{wheres.collect(&:to_sql).join(' AND ')}" unless wheres.blank? conditions << " ORDER BY #{order_clauses.join(', ')}" unless orders.blank? unless taken.blank? |