"I'm currently using the noticed gem for notifications, and I'm encountering the following problem:
undefined method `notifications_count=' for #<AppointmentNotifier id: nil, type: "AppointmentNotifier", record_type: "Appointment", record_id: 15, params: {
=>"new Message"}, created_at: nil, updated_at: nil>.
I can't find the error in any file, and I'm not calling that method. The error just occurred suddenly."
I searched in all the files for any method that might interfere, but I couldn't find anything. I also used the console to look for the error
When you see it returns
undefined method 'xxxxxx'
on an ActiveRecord object.
notifications_count
looks like a column belonging to gem noticed
so I thought it's related to data migrationConclusion: noticed
adds some additional columns to the table and you need to run rails db:migrate to add those new columns first.