Skip to content

Commit

Permalink
quote table column name with `
Browse files Browse the repository at this point in the history
  • Loading branch information
halida committed Apr 28, 2012
1 parent 4f5acaa commit 64a5d21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rails-backup-migrate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def restore_db_from_yml

puts "Loading #{tbl}..." if VERBOSE
YAML.load_file("#{tbl}.yml").each do |fixture|
ActiveRecord::Base.connection.execute "INSERT INTO #{tbl} (#{fixture.keys.join(",")}) VALUES (#{fixture.values.collect { |value| ActiveRecord::Base.connection.quote(value) }.join(",")})", 'Fixture Insert'
ActiveRecord::Base.connection.execute "INSERT INTO #{tbl} (#{fixture.keys.map{|k| "`#{k}`"}.join(",")}) VALUES (#{fixture.values.collect { |value| ActiveRecord::Base.connection.quote(value) }.join(",")})", 'Fixture Insert'
end
end
end
Expand Down

0 comments on commit 64a5d21

Please sign in to comment.