lib/toaster/model/task_execution.rb in cloud-toaster-1.1.5 vs lib/toaster/model/task_execution.rb in cloud-toaster-1.1.6
- old
+ new
@@ -13,11 +13,11 @@
module Toaster
class TaskExecution < ActiveRecord::Base
belongs_to :task
belongs_to :automation_run
- has_many :state_changes
+ has_many :state_changes, :autosave => true, :dependent => :destroy
serialize :state_before, JSON
serialize :state_after, JSON
def initialize(attr_hash)
if !attr_hash[:uuid]
@@ -66,10 +66,11 @@
def self.find(criteria={})
DB.find_activerecord(TaskExecution, criteria)
end
def self.load_all_for_automation(auto)
- return joins(:automation_run).where(:automation_run => {:automation_id => auto.id})
+ return joins(:automation_run).where(
+ :automation_runs => {:automation_id => auto.id})
end
end
end