diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-01-12 11:13:14 +0300 |
---|---|---|
committer | Luke Bennett <lbennett@gitlab.com> | 2018-01-17 19:03:02 +0300 |
commit | 0e06553494f994b07441552b6407b17d8cb7e905 (patch) | |
tree | 4ba35864b3a3132f697cd3a7f7e4a1ae208a4cd7 /app | |
parent | 6671e32810a955511e3344e81b679b68b6b3c583 (diff) |
Merge branch 'mk-fix-permanent-redirect-validation' into 'master'
Fix Route validation when conflicting permanent redirects exist
Closes gitlab-com/support-forum#2883 and #41786
See merge request gitlab-org/gitlab-ce!16397
(cherry picked from commit d607f16fe5a1ec51eaea5811b5118b1ba48acfbc)
1dc30595 Revert "Revert "Fix Route validation for unchanged path""
c517788e Fix Rubocop offense
601c24d5 Add RedirectRoute factory
d4c8d1b7 Add changelog entry
Diffstat (limited to 'app')
-rw-r--r-- | app/models/route.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/route.rb b/app/models/route.rb index 7ba3ec06041..412f5fb45a5 100644 --- a/app/models/route.rb +++ b/app/models/route.rb @@ -8,7 +8,7 @@ class Route < ActiveRecord::Base presence: true, uniqueness: { case_sensitive: false } - validate :ensure_permanent_paths + validate :ensure_permanent_paths, if: :path_changed? after_create :delete_conflicting_redirects after_update :delete_conflicting_redirects, if: :path_changed? |