app/models/foreman_tasks/task.rb in foreman-tasks-0.13.0 vs app/models/foreman_tasks/task.rb in foreman-tasks-0.13.1
- old
+ new
@@ -18,10 +18,14 @@
belongs_to :parent_task, :class_name => 'ForemanTasks::Task'
has_many :sub_tasks, :class_name => 'ForemanTasks::Task', :foreign_key => :parent_task_id, :dependent => :nullify
has_many :locks, :dependent => :destroy
+ has_many :remote_sub_tasks, :class_name => 'ForemanTasks::RemoteTask', :through => :sub_tasks, :source => :remote_tasks
+
+ has_many :remote_tasks, :class_name => 'ForemanTasks::RemoteTask', :primary_key => :external_id, :foreign_key => :execution_plan_id, :dependent => :destroy
+
has_many :task_group_members, :dependent => :destroy
has_many :task_groups, :through => :task_group_members
if Rails::VERSION::MAJOR < 4
has_many :recurring_logic_task_groups, :through => :task_group_members, :conditions => { :type => 'ForemanTasks::TaskGroups::RecurringLogicTaskGroup' }, :source => :task_group
has_many :owners, :through => :locks, :source => :resource, :source_type => 'User',
@@ -208,10 +212,11 @@
end
result.symbolize_keys
end
def action
- super || to_label
+ return to_label if super.blank?
+ super
end
def to_label
parts = []
parts << get_humanized(:name)