On Apr 20, 3:33 pm, Fearless Fool <[email protected]> wrote:
> @fred: You may be right, but in that case, the documentation is wrong. > From > > http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Sc... > > we have: > > > :id - Whether to automatically add a primary key column. Defaults > > to true. Join tables for has_and_belongs_to_many should set > > :id => false. > > And, as I hinted at, this IS a join table. > > What's interesting is that I cleared the table and rebuilt it -- no > error. When I tried to update the entire table (with identical values), > it gave the same error on the same record. Curiouser and curiouser. > Join tables of the habtm variety are just join tables and typically have no associated model - the assumption is that they are only manipulated behind the scenes by active record. If you're going do be doing foo.save! (or foo.update_attributes which calls save) then you need a primary key, it's just how active record works Fred -- 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.

