Hello!

I've inherited a schema which is in a live app that makes heavy use of 
"paranoid" behaviour; that is to say it has `deleted_at` columns in just 
about every table, including join tables. I'm using the sequel-paranoid gem 
to handle this mostly.

So, I have lots of `many_to_many` associations that actually go through 
model tables, complete with their own `deleted_at`. I guess this was so all 
the associations can be restored along with the primary models if they need 
to be undeleted.

I'd like to use the `association_dependencies` plugin to manage deleting 
associations automatically, but clearly none of the existing options will 
set this `deleted_at` in the many_to_many join table. I appreciate that 
Sequel doesn't ship with paranoid support so it would be undesirable to 
simply add a new `:paranoid` option to `association_dependencies`.

My next thought therefore was, could we specify a block for each 
association to call our own code? I could then have something set 
`deleted_at` on each row, instead of removing the row entirely. Would it be 
possible to pass the dataset of rows being updated to this block? Or each 
row individually would work too.

Would this be something that cold be considered for inclusion Jeremy?

Thanks!
Chris

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to