Skip to content
Browse files

Quoted path to <Rails.env>_structure.sql file in db:test:clone_struct…

…ure task.

Leaving the path unquoted causes errors in paths containing spaces or dashes.
  • Loading branch information...
1 parent 1eac911 commit 80e0cd32905d74b7f0779807d9b2428d5d0ce64b @jrmehle jrmehle committed Oct 3, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/railties/databases.rake
View
4 activerecord/lib/active_record/railties/databases.rake
@@ -424,10 +424,10 @@ db_namespace = namespace :db do
ENV['PGHOST'] = abcs['test']['host'] if abcs['test']['host']
ENV['PGPORT'] = abcs['test']['port'].to_s if abcs['test']['port']
ENV['PGPASSWORD'] = abcs['test']['password'].to_s if abcs['test']['password']
- `psql -U "#{abcs['test']['username']}" -f #{Rails.root}/db/#{Rails.env}_structure.sql #{abcs['test']['database']} #{abcs['test']['template']}`
+ `psql -U "#{abcs['test']['username']}" -f "#{Rails.root}/db/#{Rails.env}_structure.sql" #{abcs['test']['database']} #{abcs['test']['template']}`
when /sqlite/
dbfile = abcs['test']['database'] || abcs['test']['dbfile']
- `sqlite3 #{dbfile} < #{Rails.root}/db/#{Rails.env}_structure.sql`
+ `sqlite3 #{dbfile} < "#{Rails.root}/db/#{Rails.env}_structure.sql"`
when 'sqlserver'
`sqlcmd -S #{abcs['test']['host']} -d #{abcs['test']['database']} -U #{abcs['test']['username']} -P #{abcs['test']['password']} -i db\\#{Rails.env}_structure.sql`
when 'oci', 'oracle'

0 comments on commit 80e0cd3

Please sign in to comment.
Something went wrong with that request. Please try again.