diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-05-24 15:12:11 -0700 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-05-24 19:13:54 -0300 |
commit | 6775ad8c61b18e0df2df7c7103478d4f315c0cb3 (patch) | |
tree | 0637fa6080e7b314333868ac931712958f95f937 /activerecord/lib/active_record/railties | |
parent | b0ebdf3e744baa935c0d9325780121e7fcac9d9a (diff) | |
download | rails-6775ad8c61b18e0df2df7c7103478d4f315c0cb3.tar.gz rails-6775ad8c61b18e0df2df7c7103478d4f315c0cb3.tar.bz2 rails-6775ad8c61b18e0df2df7c7103478d4f315c0cb3.zip |
Merge pull request #5925 from Juanmcuello/pg_structure_dump
Quote arguments in db:structure:dump for PostgreSQL.
Diffstat (limited to 'activerecord/lib/active_record/railties')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index f26e18b1e0..791a22958c 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -406,9 +406,9 @@ db_namespace = namespace :db do set_psql_env(abcs[Rails.env]) search_path = abcs[Rails.env]['schema_search_path'] unless search_path.blank? - search_path = search_path.split(",").map{|search_path_part| "--schema=#{search_path_part.strip}" }.join(" ") + search_path = search_path.split(",").map{|search_path_part| "--schema=#{Shellwords.escape(search_path_part.strip)}" }.join(" ") end - `pg_dump -i -s -x -O -f #{filename} #{search_path} #{abcs[Rails.env]['database']}` + `pg_dump -i -s -x -O -f #{Shellwords.escape(filename)} #{search_path} #{Shellwords.escape(abcs[Rails.env]['database'])}` raise 'Error dumping database' if $?.exitstatus == 1 when /sqlite/ dbfile = abcs[Rails.env]['database'] |