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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Greg Donald
2008-May-13 02:48 UTC
Re: What are folks using these days for "paranoid" deletion?
On Mon, May 12, 2008 at 9:43 PM, schof <sean.schofield-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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.I usually use a "deleted" field. Simple, works. -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Nicholas Henry
2008-May-13 02:50 UTC
Re: What are folks using these days for "paranoid" deletion?
I haven''t used anything recently but came across this one today: http://github.com/JackDanger/permanent_records/tree/master On May 12, 10:43 pm, schof <sean.schofi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> 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? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jack Christensen
2008-May-13 13:34 UTC
Re: What are folks using these days for "paranoid" deletion?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> schof wrote: <blockquote cite="mid:2109bd4c-3bf4-4696-af60-91874e6afdc9-59APb0v9vdKfAYmsQHFBWGB/v6IoIuQBVpNB7YpNyf8@public.gmane.org" type="cite"> <pre wrap=""> </pre> <blockquote type="cite"> <pre wrap="">I usually use a "deleted" field. Simple, works. </pre> </blockquote> <pre wrap=""><!----> 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? </pre> </blockquote> The named_scope functionality of Rails 2.1 could simplify this.<br> <blockquote cite="mid:2109bd4c-3bf4-4696-af60-91874e6afdc9-59APb0v9vdKfAYmsQHFBWGB/v6IoIuQBVpNB7YpNyf8@public.gmane.org" type="cite"> <pre wrap=""> Any other suggestions out there? </pre> </blockquote> <br> <br> <pre class="moz-signature" cols="72">-- Jack Christensen <a class="moz-txt-link-abbreviated" href="mailto:jackc-/SOt/BrQZzMOf2zXYvRtkodd74u8MsAO@public.gmane.org">jackc-/SOt/BrQZzMOf2zXYvRtkodd74u8MsAO@public.gmane.org</a> </pre> <br> --~--~---------~--~----~------------~-------~--~----~<br> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. <br> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en <br> -~----------~----~----~----~------~----~------~--~---<br> </body> </html> <br>
I had a feeling named scope might be helpful here. Thanks for the tip. I will look into it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---