On Aug 12, 12:38 pm, bingo bob <[email protected]>
wrote:
> So if I've understood you correctly,
>
> I could just edit this
>
> in advert.rb
> has_and_belongs_to_many :resorts
>
> in resort.rb
> has_and_belongs_to_many :adverts
>
> to include , :foreign_key => "serial_number"
>
> Which one (or both) do I specify the foreign key on and importantly does
> the join table migration work as it is?

a bit more complicated with a has_and_belongs_to_many - there's
a :foreign_key and :association_foreign_key (one for each 'side' -
check the docs). not sure what you mean about the migration working.

Fred
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to