diff --git a/app/models/deploy.rb b/app/models/deploy.rb index 98e6d0a..907739f 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 b053a6f..2d6e315 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') },