search for: atalias

Displaying 1 result from an estimated 1 matches for "atalias".

Did you mean: alias
2011 Nov 03
0
Arel table aliases and ActiveRecord::Relation help: how to specify "multiple has_many items in a query"
What is the recommended way to use table aliases with ActiveRecord::Relation these days? In prior versions of Rails, this would work: assume (pseudo code): model A has_many b''s model B ,,, at = B.arel_table atalias = at.alias(at.name + "_1") A.join(:b).join(atalias).where(atalias[:a_id].eq(at[:a_id]).where("b.widget = ''foo''").where("b_1.widget = ''bar''"). ... ^ probably should be "on" now in 3.1.1: pas...