Using primary key that is not named "id"

Hi

I am using a legacy database that the primary key is named “ProductID”
and its type is SERIAL (or INT NOT NULL auto_increment).

set_primary_key “ProductID”, is added to the Product class

Then I used >ruby script/generate scaffold Product Admin
to generate my controllers. When I try to insert a new product in the
products table, it gave me this error

RuntimeError: ERROR C42P01 Mrelation “product_productid_seq” does not
exist Fnamespace.c L195 RRangeVarGetRelid: SELECT
currval(‘Product_ProductID_seq’)

What does this mean and is what can I do to solve this?

Thank you!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs