Entry not updated in database table(Active Record Error)

Hello All,

I have a table invitation_workflows.Entry to this table is done via method send_invite which is called on the click of an Invite button. When I click on Invite button for the first time,entry gets created in the invitation_workflows table. However on subsequent clicks,the following error is shown

What the error says is you do not have an id column. All tables which back an ActiveRecord Model must include an auto-incrementing primary key, by tradition named 'id'. There are no exceptions to this as far as I know.

If you are making a "join model", then you also have to have an id. The only exception would be a habtm relationship join, which by definition can only have two columns: model_a_id and model_b_id.

Walter

Rails assumes the presence of a primary key column called id. If it's called something else then you need to tell rails this (via the set_primary_key method). Have you?

Fred

Hi Frederick, Thanks for the response.Yes primary key was not set.I set it and it worked. :slight_smile:

Hi Walter, Thanks for the information. :slight_smile:

Regards Chandrika