impressionist
impressionist copied to clipboard
Mongoid overwriting fields warning
Hi there. While using Impressionist with Mongoid my logs always show these two warnings:
W [13:69927300766100] Mongoid -- Overwriting existing field impressionable_id in class Impression.
W [13:69927300766100] Mongoid -- Overwriting existing field impressionable_type in class Impression.
Impressionist first sets up some accessors for the base model here, but then overwrites them right after. Mongoid tries to then add those accessors and complains.
If this is required by design, it would be helpful to add the overwrite: true
to the Mongoid field definitions to suppress this warning. Otherwise, removing the manual addition of the accessors for those two fields would free Mongoid to simply do its thing and add them itself.
Thanks!
Hi @UnquietCode. Thanks for describing the issue. I realize this is super old but as I've recently tasked myself with maintaining the project I would love to get this resolved. Is this still an issue? Would you be up for submitting a pull request to fix it?
Greetings, and welcome! I am very far removed from the original codebase at this point, but my understanding is that in the latest versions of rails and everything else, this is no longer an issue.