Class: Ci::FreezePeriodsFinder
- Inherits:
-
Object
- Object
- Ci::FreezePeriodsFinder
- Defined in:
- app/finders/ci/freeze_periods_finder.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project, current_user = nil) ⇒ FreezePeriodsFinder
constructor
A new instance of FreezePeriodsFinder.
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
#execute ⇒ Object
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 |