Forum: Ruby on Rails has_many :through does it support collection_singular_ids ?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Christos Z. (Guest)
on 2006-12-31 01:36
(Received via mailing list)
Good evening list members,

I have the following model:

  class Author < ActiveRecord::Base
    has_many :authorships
    has_many :books, :through => : authorships

Should I be able to do the following?

  Author.find(:first).book_ids = [1,2,3]

I ask, because it doesn't. The docs state that it should, but it
doesn't specialise in the case of a :through

This works fine BTW:

  Author.find(:first).authorship_ids = [12,13]

Do I really need to find and add (<<) my associated join models for
books one by one?

This topic is locked and can not be replied to.