[Rails] Re: when is it okay to resort to find_by_sql?

2010-09-10 Thread Fearless Fool
Marnen Laibow-Koser wrote: There are relatively few cases (not none, but few) where a subquery should not be replaced by a join. Are you sure you need that subquery? Marnen: I owe your a debt of gratitude. Your note spurred me to *really* grok SQL joins. After thirty six hours of study

[Rails] Re: when is it okay to resort to find_by_sql?

2010-09-08 Thread Marnen Laibow-Koser
Fearless Fool wrote: When is it appropriate to resort to find_by_sql? When you need something that can't be done any other way. I'm all for portable, easily maintained code. I'm a HUGE fan the new ActiveRecord::Relation model in Rails 3.0 I keenly feel the peril of dropping into

[Rails] Re: when is it okay to resort to find_by_sql?

2010-09-08 Thread Fearless Fool
Marnen Laibow-Koser wrote (among other things...) Question 2: Nested queries. In my system, inner_query is, in fact, an inner query that appears within this little monster: ... There are relatively few cases (not none, but few) where a subquery should not be replaced by a join. Are you

[Rails] Re: when is it okay to resort to find_by_sql?

2010-09-08 Thread Fearless Fool
Fearless Fool wrote: Well, then, Manen, help me understand if I need that subquery. Fiddlesticks. Marnen, pardon my typo (again) on the spelling of your name. - Frealess Foole -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google

[Rails] Re: when is it okay to resort to find_by_sql?

2010-09-08 Thread Marnen Laibow-Koser
Fearless Fool wrote: Marnen Laibow-Koser wrote (among other things...) Question 2: Nested queries. In my system, inner_query is, in fact, an inner query that appears within this little monster: ... There are relatively few cases (not none, but few) where a subquery should not be replaced