On Mon, Mar 21, 2011 at 11:29 AM, Frederick Cheung < [email protected]> wrote:
> > > On Mar 21, 5:19 pm, David Kahn <[email protected]> wrote: > > When I do such a query, AR misses the second 1/2 of the where clause > > (assigned_product_id): > > > > > XpRawBillDetailProduct.joins(:xp_raw_bill_detail).where("xp_raw_bill_detail > s.account_subcode_id=#{ > > account_subcode.id}", :assigned_product_id => > > raw_bill_product.assigned_product_id).to_sql > > If you do this, AR assumes that the hash you provided is a map for > substituting named bind variables (ie if your query contained " AND > assigned_product_id = :assigned_product_id" it would > replace :assigned_product_id with the value from the hash > Thanks Fred, makes sense. > > Fred > > -- > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

