diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-01-05 14:43:50 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-01-13 10:05:02 -0500 |
commit | 51c4b20c48f29fe34fd1306f7a115f645eb9fb71 (patch) | |
tree | 645824aae9ec7fb73bf6be8496f2a3710804ffff /app/models/route.rb | |
parent | 4b43126d08972c201551fbd1fe42e85847d5e03f (diff) | |
download | gitlab-ce-51c4b20c48f29fe34fd1306f7a115f645eb9fb71.tar.gz |
Refactor Namespace code related to nested groups
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/route.rb')
-rw-r--r-- | app/models/route.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/route.rb b/app/models/route.rb index caf596efa79..ebd18dce737 100644 --- a/app/models/route.rb +++ b/app/models/route.rb @@ -8,9 +8,9 @@ class Route < ActiveRecord::Base presence: true, uniqueness: { case_sensitive: false } - after_update :rename_children, if: :path_changed? + after_update :rename_descendants, if: :path_changed? - def rename_children + def rename_descendants # We update each row separately because MySQL does not have regexp_replace. # rubocop:disable Rails/FindEach Route.where('path LIKE ?', "#{path_was}/%").each do |route| |