Skip to content

Commit

Permalink
Fixes #18515 - add scheduling helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
adamruzicka authored and iNecas committed Mar 24, 2017
1 parent 6abdbae commit 6394e93
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/models/foreman_tasks/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def username
end

def execution_type
start_at.to_i == started_at.to_i ? N_('Immediate') : N_('Delayed')
delayed? ? N_('Delayed') : N_('Immediate')
end

def humanized
Expand All @@ -96,6 +96,14 @@ def paused?
state == 'paused'
end

def recurring?
!recurring_logic_task_group_ids.empty?
end

def delayed?
start_at.to_i != started_at.to_i
end

def self_and_parents
[self].tap do |ret|
ret.concat(parent_task.self_and_parents) if parent_task
Expand Down

0 comments on commit 6394e93

Please sign in to comment.