Skip to content

Model destroy actions for associated models

Patrick Bolger edited this page Jan 5, 2018 · 32 revisions

Company

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

Payment

Model Association Tested? Considerations
User belongs_to Yes
Company belongs_to, optional Yes

ShfApplication

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?
Clone this wiki locally