forked from thesuss/shf-project
-
Notifications
You must be signed in to change notification settings - Fork 37
Model destroy actions for associated models
Patrick Bolger edited this page Jan 5, 2018
·
32 revisions
Model | Association | Tested? | Considerations |
---|---|---|---|
ShfApplication | has_many, dependent: :destroy | Yes | |
User | has_many, through: :shf_applications | Yes | |
Payment | has_many, dependent: :destroy | Yes | Retain payment records? (perhaps via dependent: nullify). Or, archive payment records? Or, use HIPS as audit source as needed? |
BusinessCategory | has_many, through: :shf_applications | Yes | |
Address | has_many, dependent: :destroy | Yes | |
Picture | has_many, dependent: :destroy | Yes |
Model | Association | Tested? | Considerations |
---|---|---|---|
User | belongs_to | Yes | |
Company | belongs_to, optional | Yes |
Model | Association | Tested? | Considerations |
---|---|---|---|
User | belongs_to | Yes | |
Company | belongs_to, optional | Yes | |
BusinessCategory | has_and_belongs_to_many | Yes | |
Admin::MemberAppWaitingReason | belongs_to | Yes | Should we destroy custom reasons when app is destroyed? |