Question

I've followed the instructions here, installing the composite_primary_keys gem via

sudo gem install composite_primary_keys

That worked fine. Now when I add the following to my model

set_primary_keys :user_id, :group_id

and I get

undefined method `set_primary_keys' for #<Class:0x1043bfe20>

Also, using multiple primary keys in a migration as described here has no effect.

Any ideas why this might not be working and how to make it work?

Note: I do not want a speech on why I should not be using composite keys--I have already made up my mind and just want to get this working. Thanks!

Was it helpful?

Solution

Did you add require 'composite_primary_keys' to the bottom of your environment.rb file as described here?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top