diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-05-03 10:33:01 -0700 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-05-05 12:11:58 -0700 |
commit | ca5c762cf577838a98c0ba96ce20b5f1d5dafc91 (patch) | |
tree | 4c9a8c50c18e075ce9b3d0dc1fc3843bbacdf366 /app/models/route.rb | |
parent | 72872ee2136436e48ce394268fc8bfb8a2118810 (diff) | |
download | gitlab-ce-ca5c762cf577838a98c0ba96ce20b5f1d5dafc91.tar.gz |
Refactor
Diffstat (limited to 'app/models/route.rb')
-rw-r--r-- | app/models/route.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/route.rb b/app/models/route.rb index e0d85ff7db7..accc423ae46 100644 --- a/app/models/route.rb +++ b/app/models/route.rb @@ -43,11 +43,13 @@ class Route < ActiveRecord::Base RedirectRoute.matching_path_and_descendants(path) end - def create_redirect_for_old_path - create_redirect(path_was) if path_changed? - end - def create_redirect(path) RedirectRoute.create(source: source, path: path) end + + private + + def create_redirect_for_old_path + create_redirect(path_was) if path_changed? + end end |