diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-11-06 10:40:29 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-11-06 10:40:29 +0100 |
commit | 3a174c999dfb61f2dde53f6eb7b2baec8b5e3683 (patch) | |
tree | b39eb504b5206af059052470132cab88dbfcd340 /app/models/group.rb | |
parent | 6947646d00a7a71984d54087452b0d004429b047 (diff) | |
parent | 4274418733c75198c38df5745c2827c6009bbc65 (diff) | |
download | gitlab-ce-3a174c999dfb61f2dde53f6eb7b2baec8b5e3683.tar.gz |
Merge branch '36629-35958-add-cluster-application-section' into add-ingress-to-cluster-applications
Diffstat (limited to 'app/models/group.rb')
-rw-r--r-- | app/models/group.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/group.rb b/app/models/group.rb index 4e8023cdb7f..c660de7fcb6 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -42,6 +42,7 @@ class Group < Namespace after_create :post_create_hook after_destroy :post_destroy_hook after_save :update_two_factor_requirement + after_update :path_changed_hook, if: :path_changed? class << self def supports_nested_groups? @@ -295,6 +296,12 @@ class Group < Namespace list_of_ids.reverse.map { |group| variables[group.id] }.compact.flatten end + def full_path_was + return path_was unless has_parent? + + "#{parent.full_path}/#{path_was}" + end + private def update_two_factor_requirement @@ -303,6 +310,10 @@ class Group < Namespace users.find_each(&:update_two_factor_requirement) end + def path_changed_hook + system_hook_service.execute_hooks_for(self, :rename) + end + def visibility_level_allowed_by_parent return if visibility_level_allowed_by_parent? |