Hi, I''ve run into two small problems with acts_as_paranoid and wondered if anyone else has experienced them as well (and if yes, if they have any solutions). 1. When using has_many :through, AAP doesn''t seem to take into account the fact that your join model might also be paranoid. My solution to this at the moment is to add an explicit conditions clause to the has_many :through statement, i.e. "join_model.deleted_at IS NULL" - is there a better way of getting the same result? 2. My tests sometimes fail in a random fashion. Looking at the test.log, nothing is different between test invocations, so the only conclusion I can come to is that it has something to do with the timestamp comparison sometimes working and sometimes not. I''m not sure that the clock is set to 100% second accuracy on the machine I''m working on. Has anyone else had a similar problem? Any comments much appreciated, TIA, Roland --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
apsoto-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-10 17:02 UTC
Re: Two problems with Acts_as_paranoid
Can you give a little more detail on the scenario? What''s a sample find call that''s causing you problems? Alex Roland Swingler wrote:> Hi, > > I''ve run into two small problems with acts_as_paranoid and wondered if > anyone else has experienced them as well (and if yes, if they have any > solutions). > > 1. When using has_many :through, AAP doesn''t seem to take into account > the fact that your join model might also be paranoid. My solution to > this at the moment is to add an explicit conditions clause to the > has_many :through statement, i.e. "join_model.deleted_at IS NULL" - is > there a better way of getting the same result? > > 2. My tests sometimes fail in a random fashion. Looking at the > test.log, nothing is different between test invocations, so the only > conclusion I can come to is that it has something to do with the > timestamp comparison sometimes working and sometimes not. I''m not sure > that the clock is set to 100% second accuracy on the machine I''m > working on. Has anyone else had a similar problem? > > Any comments much appreciated, > > TIA, > Roland--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
vorwaller-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-22 05:26 UTC
Re: Two problems with Acts_as_paranoid
I can verify that using has_many :through and acts_as_paranoid on the join model deleting a join works but finding through the join ignores the delete_at value. As Roland mentioned, this works: indicators = user.indicators.find(:all, :conditions => ''personal_indicators.deleted_at IS NULL'') Marcus On 10 Jan, 15:02, "aps...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <aps...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Can you give a little more detail on the scenario? What''s a sample > find call that''s causing you problems? > > Alex > > Roland Swingler wrote: > > Hi, > > > I''ve run into two small problems with acts_as_paranoid and wondered if > > anyone else has experienced them as well (and if yes, if they have any > > solutions). > > > 1. When using has_many :through, AAP doesn''t seem to take into account > > the fact that your join model might also be paranoid. My solution to > > this at the moment is to add an explicit conditions clause to the > > has_many :through statement, i.e. "join_model.deleted_at IS NULL" - is > > there a better way of getting the same result? > > > 2. My tests sometimes fail in a random fashion. Looking at the > > test.log, nothing is different between test invocations, so the only > > conclusion I can come to is that it has something to do with the > > timestamp comparison sometimes working and sometimes not. I''m not sure > > that the clock is set to 100% second accuracy on the machine I''m > > working on. Has anyone else had a similar problem? > > > Any comments much appreciated, > > > TIA, > > Roland--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---