Class: ProjectGroupLink

Inherits:
ApplicationRecord show all
Includes:
Expirable
Defined in:
app/models/project_group_link.rb

Constant Summary

Constants included from Expirable

Expirable::DAYS_TO_EXPIRE

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Expirable

#expired?, #expires?, #expires_soon?

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Class Method Details

.access_optionsObject


20
21
22
# File 'app/models/project_group_link.rb', line 20

def self.access_options
  Gitlab::Access.options
end

.default_accessObject


24
25
26
# File 'app/models/project_group_link.rb', line 24

def self.default_access
  Gitlab::Access::DEVELOPER
end

.search(query) ⇒ Object


28
29
30
# File 'app/models/project_group_link.rb', line 28

def self.search(query)
  joins(:group).merge(Group.search(query))
end

Instance Method Details

#human_accessObject


32
33
34
# File 'app/models/project_group_link.rb', line 32

def human_access
  self.class.access_options.key(self.group_access)
end