Commit 2f5095c2 authored by Shinya Maeda's avatar Shinya Maeda Committed by Kamil Trzcinski

Add def trigger_schedule in Trigger. Use persisted? for checling existance

parent 4131ed2b
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment