Class: Ci::FreezePeriodsFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/ci/freeze_periods_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(project, current_user = nil) ⇒ FreezePeriodsFinder

Returns a new instance of FreezePeriodsFinder.



5
6
7
8
# File 'app/finders/ci/freeze_periods_finder.rb', line 5

def initialize(project, current_user = nil)
  @project = project
  @current_user = current_user
end

Instance Method Details

#executeObject



10
11
12
13
14
# File 'app/finders/ci/freeze_periods_finder.rb', line 10

def execute
  return Ci::FreezePeriod.none unless Ability.allowed?(@current_user, :read_freeze_period, @project)

  @project.freeze_periods
end