Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composite Primary Keys in Rails still being ignored

I've set up a database that has composite primary keys for Ruby on Rails. Creating the migration works, but when I start to seed the database, I still get a warning that "Active Record does not support primary keys." and that the "Composite primary key is ignored." even after I've installed the composite_primary_keys gem, and included require 'composite_primary_keys' into the environments.rb file.

Any thoughts as to why the composite primary key is still ignored?

like image 508
limciana Avatar asked Nov 24 '25 22:11

limciana


1 Answers

Well, I found the work-around to this. For every model that I had that has composite primary keys, I included require 'composite_primary_keys' on the start of the class. Seems to work for me.

like image 176
limciana Avatar answered Nov 27 '25 13:11

limciana