refactored migration based on feedback
This commit is contained in:
parent
7b868c61ab
commit
5dc77d7577
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue