diff --git a/app/models/deploy.rb b/app/models/deploy.rb index 98e6d0a1..907739f2 100644 --- a/app/models/deploy.rb +++ b/app/models/deploy.rb @@ -9,7 +9,7 @@ require 'open3' # :attributes`. class Deploy < ApplicationRecord belongs_to :site - has_many :build_stats + has_many :build_stats, dependent: :destroy def deploy raise NotImplementedError diff --git a/app/models/site.rb b/app/models/site.rb index b053a6fc..2d6e315c 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -36,10 +36,10 @@ class Site < ApplicationRecord belongs_to :design belongs_to :licencia - has_many :log_entries - has_many :deploys + has_many :log_entries, dependent: :destroy + has_many :deploys, dependent: :destroy has_many :build_stats, through: :deploys - has_many :roles + has_many :roles, dependent: :destroy has_many :usuaries, -> { where('roles.rol = ?', 'usuarie') }, through: :roles has_many :invitades, -> { where('roles.rol = ?', 'invitade') },