diff options
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 20011b073ee..96e3a9e0f8f 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1079,8 +1079,10 @@ class Project < ApplicationRecord end def preload_protected_branches - preloader = ActiveRecord::Associations::Preloader.new - preloader.preload(self, protected_branches: [:push_access_levels, :merge_access_levels]) + ActiveRecord::Associations::Preloader.new( + records: [self], + associations: { protected_branches: [:push_access_levels, :merge_access_levels] } + ).call end # returns all ancestor-groups upto but excluding the given namespace |