diff options
author | James Lopez <james@jameslopez.es> | 2016-02-04 15:35:03 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-02-04 15:35:03 +0100 |
commit | 5dc77d7577bf19586f6cd756678d0c2660e7f868 (patch) | |
tree | 0d74cca14250e4835cf13857285ae634e5fb6fb2 /db | |
parent | 7b868c61ab371fc9319e6dd1baa2c089bc275618 (diff) | |
download | gitlab-ce-5dc77d7577bf19586f6cd756678d0c2660e7f868.tar.gz |
refactored migration based on feedback
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb b/db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb index bb79ac026c2..091de54978b 100644 --- a/db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb +++ b/db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb @@ -61,7 +61,7 @@ class RemoveDotAtomPathEndingOfProjects < ActiveRecord::Migration private def clean_path(project_path) - execute "UPDATE projects SET path = '#{project_path.clean_path}' WHERE id = #{project_path.id}" + execute "UPDATE projects SET path = #{sanitize(project_path.clean_path)} WHERE id = #{project_path.id}" end def rename_project_repo(project_path) @@ -73,4 +73,8 @@ class RemoveDotAtomPathEndingOfProjects < ActiveRecord::Migration rescue false end + + def sanitize(value) + ActiveRecord::Base.connection.quote(value) + end end |