When counter_cache on wrong side of association
Absentmindedly put a
counter_cache declaration on the
has_many instead of where it belongs (pun intended.)
Rails 5 will complain in the most cryptic way it possibly can, which is to raise the following exception
ActiveModel::MissingAttributeError: can't write unknown attribute `true`
If you get that error, now you know how to fix it. Good luck and godspeed.