Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
5dc77d75
Commit
5dc77d75
authored
Feb 04, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored migration based on feedback
parent
7b868c61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb
...20160129135155_remove_dot_atom_path_ending_of_projects.rb
+5
-1
No files found.
db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb
View file @
5dc77d75
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment