[Rails-core] Any interest in inferred joins?

2010-04-20 Thread Ernie Miller
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

Re: [Rails-core] Any interest in inferred joins?

2010-04-20 Thread Pratik
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

Re: [Rails-core] Any interest in inferred joins?

2010-04-20 Thread Norman Clarke
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

Re: [Rails-core] Any interest in inferred joins?

2010-04-20 Thread Ernie Miller
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