Hi,

Imagine the scenarios where I have 3 tables =>   :foos, :bars, :foos_bars
I have 2 (perhaps 3) models => Foo, Bar (, FooBar)

and the Foo model looks like this =>

class Foo < Sequel::Model
  many_to_many :bars, :join_table => :foos_bars, :class => 'Bar'
end

Within 'foos_bars' I have a column which describes the relationship
between Foo and Bar so :foos_bars's schema is something like:
{
  foreign_key :foo_id, :table => :foos, :null => false
  foreign_key :bar_id, :table => :bars, :null => false
  varchar relationship, :size => 32, :null => false
}

My problem is as follows, how can I use foo.add_bar when there's
column data required in the joining table, for example:
{
  foo = Foo.create( ... )
  bar = Bar.create( ...)

  # foo.add_bar( bar, :relationship => "baz" ) # Unfortunately this
does not work

  foo.add_bar( bar ) # How do I do this? where do I describe relationship?
}

Thanks,
Clive

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