On 20 fév, 13:58, Simon Arnaud <[email protected]> wrote: > Something that would look like : > Person.filter( :shoes => { :color => 'red' }).filter( :shoes => > { :country => { :name => 'france' } } )
the more I think about it, the more I think it should be simple. I can do something like : Person.query do join_table :inner, Shoe, :id => :people__id filter :shoes__color => 'red' end which is basically SQL, with a ruby DSL. Note how I have to rewrite the join, when the Person class already knows about it, through the one_to_many :shoes. And how I have to use the table name, and can't use the class for shoes in the filter. It seems I should be able to write one of those : Person.filter(Shoe.color => 'red') Person.filter(shoes.filter(:color => 'red')) Person.filter(:shoes.filter(:color => 'red')) Person.filter(Shoe.filter(:color => 'red')) as Sequel knows about the join already. What do you think ? Simon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-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/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
