Hello all, I am wondering how people here are handling soft deletes in Rails. I''ve need a couple of gems/plugins that seem to handle this but from what I gather development has stopped on them. All I need to do right now is mark something as deleted in the DB...nothing fancy. I''m thinking that the simple addition of a deleted_at column, some named scopes (maybe even a default scope) and a handler on delete to set the deleted_at column and prevent the actual DB delete will do the trick. Any gotchas that I need to watch out for? Thanks in advance. Mike -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.
Hello all, I am wondering how people here are handling soft deletes in Rails. I''ve need a couple of gems/plugins that seem to handle this but from what I gather development has stopped on them. All I need to do right now is mark something as deleted in the DB...nothing fancy. I''m thinking that the simple addition of a deleted_at column, some named scopes (maybe even a default scope) and a handler on delete to set the deleted_at column and prevent the actual DB delete will do the trick. Any gotchas that I need to watch out for? Thanks in advance. Mike -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.
Hi Mike, On Mon, 2009-11-23 at 07:45 -0800, Mike Gehard wrote:> I''m thinking that the simple addition of a deleted_at column, some > named scopes (maybe even a default scope) and a handler on delete to > set the deleted_at column and prevent the actual DB delete will do the > trick. Any gotchas that I need to watch out for?Sounds entirely reasonable. Best regards, Bill -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.
we do this in conjunction with versioning our records, makes it very easy to pull associations through history. You''re definitely on the right track. On Mon, Nov 23, 2009 at 11:12 AM, bill walton <bwalton.im-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Mike, > > On Mon, 2009-11-23 at 07:45 -0800, Mike Gehard wrote: > > I''m thinking that the simple addition of a deleted_at column, some > > named scopes (maybe even a default scope) and a handler on delete to > > set the deleted_at column and prevent the actual DB delete will do the > > trick. Any gotchas that I need to watch out for? > > Sounds entirely reasonable. > > Best regards, > Bill > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=. > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.
I''ve used the acts_as_paranoid plugin successfully for this. On Nov 24, 3:21 am, Chris Drappier <chris.drapp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> we do this in conjunction with versioning our records, makes it very easy to > pull associations through history. You''re definitely on the right track. > > On Mon, Nov 23, 2009 at 11:12 AM, bill walton <bwalton...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi Mike, > > > On Mon, 2009-11-23 at 07:45 -0800, Mike Gehard wrote: > > > I''m thinking that the simple addition of a deleted_at column, some > > > named scopes (maybe even a default scope) and a handler on delete to > > > set the deleted_at column and prevent the actual DB delete will do the > > > trick. Any gotchas that I need to watch out for? > > > Sounds entirely reasonable. > > > Best regards, > > Bill > > > -- > > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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=.
Mike, I''ve implemented exactly what you''re talking about, sans gems/ plugins. I starting down that road on deciding which plugin to use but the more I thought about it, the more I realized I didn''t need a plugin...my needs were pretty simple. The problem I had with the plugins was how they changed your AR finders behind the scenes. I implemented my own named scopes and it works fine for me. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks all...I decided to forgoe the plugins/gems because the authors of both of the recommended ones (acts_as_paranoid and is_paranoid) have both decided that named scopes are the way to go for this. On Nov 24, 3:46 pm, Lee Smith <autige...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Mike, > > I''ve implemented exactly what you''re talking about, sans gems/ > plugins. I starting down that road on deciding which plugin to use > but the more I thought about it, the more I realized I didn''t need a > plugin...my needs were pretty simple. The problem I had with the > plugins was how they changed your AR finders behind the scenes. I > implemented my own named scopes and it works fine for me.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On Nov 21, 3:16 am, Mike Gehard <m...-TxOnFEgXotrc+919tysfdA@public.gmane.org> wrote:> Hello all, > > I am wondering how people here are handling soft deletes in Rails. > I''ve need a couple of gems/plugins that seem to handle this but from > what I gather development has stopped on them. > > All I need to do right now is mark something as deleted in the > DB...nothing fancy. > > I''m thinking that the simple addition of a deleted_at column, some > named scopes (maybe even a default scope) and a handler on delete to > set the deleted_at column and prevent the actual DB delete will do the > trick. Any gotchas that I need to watch out for? > > Thanks in advance. > MikeI''m sorry to ask you back. But I''m interested with this too. Is deleted_at handled by rails or your application? Kind regards, -- Certified Scrum Master http://blog.scrum8.com | http://jobs.scrum8.com | http://twitter.com/scrum8 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.