-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically destroy dependent records #67
Comments
Automating destruction of data doesn't seem wise to me. It's better that
the developers knows exactly what they are doing. Rails is full of examples
where such statements must explicitly be placed in each model. Danger lurks
ahead.
…On Thu, Feb 2, 2017, 02:05 jekuno ***@***.***> wrote:
Currently you have to manually add relations such as
has_many :animals, dependent: :destroy
for all tenanted models to tenant.rb.
*Idea*: Extend milia to automatically add
has_many :my_tenanted_model, dependent: destroy
associations for all tenenated models.
Does anybody have an opinion on this?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#67>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZDDOmx4MMNMv-xvAQJJhiWvAwYm1Eaks5rYapVgaJpZM4L06xm>
.
|
I agree with @dsaronin on this one. Deletion of tenanted models should be explicitly defined. |
If your applications grows over the years several developers will add more and more tenanted models. IMHO sooner or later somebody will forget to add the according Can you imagine any situation where it would be wise to delete a tenant (i.e. company or organization) but to keep records which belong to this tenant? If you want this for recovery reasons you would probably want a consistent solution for all records e.g. by using https://github.com/rubysherpas/paranoia. |
Currently you have to manually add relations such as
has_many :animals, dependent: :destroy
for all tenanted models to
tenant.rb
.Idea: Extend milia to automatically add
has_many :my_tenanted_model, dependent: destroy
associations for all tenenated models.
Does anybody have an opinion on this?
The text was updated successfully, but these errors were encountered: