How to save new record into DB after set_primary_kay and rem



I’m new in ruby and rails. I tried to set_primary_kay and remove id from
a table, but can not save new records into db because of the validation
and the _before_type_cast .

Tried to find help on the web but did not get it.

Pleas help. Thanks lot.