al eliminar un sitio eliminar otros datos relacionados
This commit is contained in:
parent
9b3eb7a804
commit
cc0a9ef3d3
2 changed files with 4 additions and 4 deletions
|
@ -9,7 +9,7 @@ require 'open3'
|
||||||
# :attributes`.
|
# :attributes`.
|
||||||
class Deploy < ApplicationRecord
|
class Deploy < ApplicationRecord
|
||||||
belongs_to :site
|
belongs_to :site
|
||||||
has_many :build_stats
|
has_many :build_stats, dependent: :destroy
|
||||||
|
|
||||||
def deploy
|
def deploy
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
|
@ -36,10 +36,10 @@ class Site < ApplicationRecord
|
||||||
belongs_to :design
|
belongs_to :design
|
||||||
belongs_to :licencia
|
belongs_to :licencia
|
||||||
|
|
||||||
has_many :log_entries
|
has_many :log_entries, dependent: :destroy
|
||||||
has_many :deploys
|
has_many :deploys, dependent: :destroy
|
||||||
has_many :build_stats, through: :deploys
|
has_many :build_stats, through: :deploys
|
||||||
has_many :roles
|
has_many :roles, dependent: :destroy
|
||||||
has_many :usuaries, -> { where('roles.rol = ?', 'usuarie') },
|
has_many :usuaries, -> { where('roles.rol = ?', 'usuarie') },
|
||||||
through: :roles
|
through: :roles
|
||||||
has_many :invitades, -> { where('roles.rol = ?', 'invitade') },
|
has_many :invitades, -> { where('roles.rol = ?', 'invitade') },
|
||||||
|
|
Loading…
Reference in a new issue