Class: FreezePeriodsFinder

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

Instance Method Summary collapse

Constructor Details

#initialize(project, current_user = nil) ⇒ FreezePeriodsFinder

Returns a new instance of FreezePeriodsFinder.


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

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

Instance Method Details

#executeObject


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

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

  @project.freeze_periods
end