Remove Default column from public_activity rails gem

134 Views Asked by At

I am using public_activity gem to track some changes in a model. I have no need for default receipt_id and receipent_type columns.

SO i just remove them from migration. But i am getting error while creating public_activity like this in controller

@batch.create_activity key: create, owner: current_user

ActiveRecord::StatementInvalid in MyController#update Mysql2::Error: Unknown column 'parameters' in 'field list': INSERT INTO `activities

1

There are 1 best solutions below

2
Severin On

As far as I understand this gem creates a separate DB entry for each change (in the same way as the paper_trail gem). This means that you need the id and type columns so the gem can match it to the object they originate from. Should work fine if you don't remove those columns.