Just curious what people are recommending these days for referential
integrity, etc. when it comes to record deletion. A while back I
looked at acts_as_paranoid and it looked promising but there were a
few issues with Rails 2.x as I seem to recall. It also seems like
that solution has fallen out of favor some and is not as widely used
anymore.
So what are some of my options if I care about record integrity? At
times I would like to delete records yet so they are not available for
future use but still preserve them for previous use.
TIA,
Sean
I usually use a "deleted" field. Simple, works.
I haven't used anything recently but came across this one today:
http://github.com/JackDanger/permanent_records/tree/master
I usually use a "deleted" field. Simple, works.
Simple but tedious and not very DRY. If you have 30+ active record
models in your application do you really implement this delete check
for all of them? Any shortcuts you can suggest?
Any other suggestions out there?
schof wrote:
I usually use a "deleted" field. Simple, works.
Simple but tedious and not very DRY. If you have 30+ active record
models in your application do you really implement this delete check
for all of them? Any shortcuts you can suggest?
The named_scope functionality of Rails 2.1 could simplify this.
I had a feeling named scope might be helpful here. Thanks for the
tip. I will look into it.