impressionist icon indicating copy to clipboard operation
impressionist copied to clipboard

Mongoid overwriting fields warning

Open UnquietCode opened this issue 9 years ago • 2 comments

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!

UnquietCode avatar Sep 10 '15 22:09 UnquietCode

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?

jgrau avatar May 25 '17 07:05 jgrau

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.

UnquietCode avatar Nov 21 '17 05:11 UnquietCode