Skip to content

Commit

Permalink
fixing test_table.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Apr 9, 2014
1 parent 02bf81f commit dc9b236
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/arel/visitors/to_sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,16 @@ def visit_Arel_Nodes_UpdateStatement o, collector
collector
end

def visit_Arel_Nodes_InsertStatement o
[
"INSERT INTO #{visit o.relation}",

("(#{o.columns.map { |x|
quote_column_name x.name
}.join ', '})" unless o.columns.empty?),
def visit_Arel_Nodes_InsertStatement o, collector
collector << "INSERT INTO "
collector = visit o.relation, collector
if o.columns.any?
collector << "(#{o.columns.map { |x|
quote_column_name x.name
}.join ', '})"
end

(visit o.values if o.values),
].compact.join ' '
maybe_visit o.values, collector
end

def visit_Arel_Nodes_Exists o, collector
Expand Down

0 comments on commit dc9b236

Please sign in to comment.