All,

Need some help, please.  many_through_many with conditions.

simple.  have 3 simple tables  players, teams, teams_players.

Player Model will have a many_through_many to get teammates.

many_through_many :teammates, [[:teams_players, :player_id, :team_id],
[:teams, :id, :id], [:teams_players, :team_id, :player_id]], :class
=> :Player

This includes self.  How do I exclude self?  I don't want to do
self.teammates - [self].  This should be done in the sql with a
condition.

I know this is will be simple, but finding it hard to find conditional
examples for sequel.

For those that might be submitting documentation, some real good
examples of exclusion queries would be good:  like: not in, not equal
to, left and right outer joins.  All of which will be good beyond what
I call the 'hello world' examples.

In my example, the current docs have 'Artist.many_through_many
artists' which is including self.  It would have been nice to see the
conditional that would return all artists except self.

Any help would be great!  Time is a crunch when you love Ruby/Sequel/
etc but only get to do it a very few hours a week and it is not my
profession.  Java/Swing/DB work pays the bills.  ;-)


Thanks,

GregD.

-- 
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.

Reply via email to