[Rails] Re: question about a where condition

2011-09-12 Thread John Merlino
thanks for responses -- 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@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For

Re: [Rails] Re: question about a where condition

2011-09-11 Thread Kevin Bedell
On Sun, Sep 11, 2011 at 5:18 PM, Walter Lee Davis wrote: > On Sep 11, 2011, at 11:45 AM, John Merlino wrote: > >> thanks for response. What you said explained a lot. >> >> Now I have never seen rails code written like that. Would it have been >> better to do this: >> >> @b.map(&:a_group).compact.u

Re: [Rails] Re: question about a where condition

2011-09-11 Thread Walter Lee Davis
On Sep 11, 2011, at 11:45 AM, John Merlino wrote: thanks for response. What you said explained a lot. Now I have never seen rails code written like that. Would it have been better to do this: @b.map(&:a_group).compact.uniq That would load up all of the elements -- whether they matched (not

[Rails] Re: question about a where condition

2011-09-11 Thread John Merlino
thanks for response. What you said explained a lot. Now I have never seen rails code written like that. Would it have been better to do this: @b.map(&:a_group).compact.uniq On Sep 11, 11:32 am, Robert Walker wrote: > John Merlino wrote in post #1021280: > > > Hey all, > > > This example of wor

[Rails] Re: question about a where condition

2011-09-11 Thread Robert Walker
John Merlino wrote in post #1021280: > Hey all, > > This example of working code: > > @a = @b.where(:a_group_id.ne => nil).collect { |b| b.a_group } > > doesn't make too much sense to me. For one, I am not sure what that > "ne" is doing there. Is this a postgresql thing? Second, it looks like The