Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Make same optimisation as #219 to all models
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesrwhite committed Apr 10, 2016
1 parent abf0fb7 commit baab766
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/minicron/hub/models/execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Hub
class Execution < ActiveRecord::Base
belongs_to :job
has_many :job_execution_outputs, :dependent => :delete_all
has_many :alerts, :dependent => :destroy
has_many :alerts, :dependent => :delete_all

validates :job_id, :presence => true, :numericality => { :only_integer => true }
validates :number, :presence => true, :numericality => { :only_integer => true }
Expand Down
2 changes: 1 addition & 1 deletion lib/minicron/hub/models/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Minicron
module Hub
class Host < ActiveRecord::Base
has_many :jobs, :dependent => :destroy
has_many :jobs, :dependent => :delete_all

validates :name, :presence => true
validates :fqdn, :presence => true, :uniqueness => true
Expand Down
4 changes: 2 additions & 2 deletions lib/minicron/hub/models/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module Minicron
module Hub
class Job < ActiveRecord::Base
belongs_to :host
has_many :executions, :dependent => :destroy
has_many :schedules, :dependent => :destroy
has_many :executions, :dependent => :delete_all
has_many :schedules, :dependent => :delete_all

validates :name, :presence => true, :uniqueness => true
validates :command, :presence => true
Expand Down
2 changes: 1 addition & 1 deletion lib/minicron/hub/models/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Minicron
module Hub
class Schedule < ActiveRecord::Base
belongs_to :job
has_many :alerts, :dependent => :destroy
has_many :alerts, :dependent => :delete_all

validates :job_id, :presence => true, :numericality => { :only_integer => true }

Expand Down

0 comments on commit baab766

Please sign in to comment.