-
-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
I have tried using this gem and belongs_to_many for the first time.
In my case I want to use it on a non-default primary key (short_id instead of id), so I define it like this:
belongs_to_many :tags, primary_key: :short_id, foreign_key: :tag_short_idsThis works fine, e.g. when using preload and calling tags on my model. However, if I try to set the tags with tags=, it uses the id column of the tags instead of the short_id.
On another note: I think there is a mistake in the wiki page for belongs_to_many where the descriptions for primary_key and foreign_key seems to be swapped in the options section.
Thanks for an awesome gem!
Metadata
Metadata
Assignees
Labels
No labels