I've been fiddling around a bit with the concept of adding inferred
join capabilities to a gem I've been working on.
The general idea, to me, is one that feels so Rails-like (as in,
principle of least surprise) that I was kind of surprised it wasn't
already in.
The goal: If you're selecting
I suppose you could override Relation#build_where
def build_where(*args)
if result = super
case args.first
when Hash
# Figure out table names from *args here and add them to
join_values or something
else
super
end
end
end
On Tue, Apr 20, 2010 at 22:42, Pratik pratikn...@gmail.com wrote:
I suppose you could override Relation#build_where
def build_where(*args)
if result = super
case args.first
when Hash
# Figure out table names from *args here and add them to
join_values or
On Apr 20, 2010, at 9:42 PM, Pratik pratikn...@gmail.com wrote:
I suppose you could override Relation#build_where
def build_where(*args)
if result = super
case args.first
when Hash
# Figure out table names from *args here and add them to
join_values or something