Add def trigger_schedule in Trigger. Use persisted? for checling existance
This commit is contained in:
parent
4131ed2bd8
commit
2f5095c254
4 changed files with 5 additions and 3 deletions
|
@ -27,7 +27,6 @@ module Projects
|
|||
def define_triggers_variables
|
||||
@triggers = @project.triggers
|
||||
@trigger = Ci::Trigger.new
|
||||
@trigger.build_trigger_schedule
|
||||
end
|
||||
|
||||
def define_badges_variables
|
||||
|
|
|
@ -34,7 +34,6 @@ class Projects::TriggersController < Projects::ApplicationController
|
|||
end
|
||||
|
||||
def edit
|
||||
@trigger.build_trigger_schedule unless @trigger.trigger_schedule.present?
|
||||
end
|
||||
|
||||
def update
|
||||
|
|
|
@ -39,5 +39,9 @@ module Ci
|
|||
def can_access_project?
|
||||
self.owner_id.blank? || Ability.allowed?(self.owner, :create_build, project)
|
||||
end
|
||||
|
||||
def trigger_schedule
|
||||
super || build_trigger_schedule
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
Never
|
||||
|
||||
%td
|
||||
- if trigger.trigger_schedule.present?
|
||||
- if trigger.trigger_schedule.persisted?
|
||||
= trigger.trigger_schedule.real_next_run
|
||||
- else
|
||||
N/A (External trigger)
|
||||
|
|
Loading…
Reference in a new issue