Resolved an issue with the Mongoid adapter + Mongoid 2.0 RC #15

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

matt-royal commented Mar 23, 2011

I ran into a problem with Pickle when using Mongoid 2.0.0.rc.8 . Mongoid::Document::PickleAdapter.model_classes assumes that all descendants of Mongoid::Document will be a model, but Mongoid 2.0 creates an empty nameless class that includes Mongoid::Document inside Mongoid::Config#destructive_fields. This nameless instance causes a NilClass exception inside model_classes.

I didn't see any tests for Mongoid in your suite (please let me know if I missed them), so I did not include a new test for this situation. The change is small and innocuous, though, so a test may not be necessary.

Thanks for all of your great work on Pickle,
-Matt Royal

Matt Royal and others added some commits Mar 23, 2011

Matt Royal The Mongoid adapter ignores classes instances without a name
An anonymous class that includes Mongoid::Document is created in
Mongoid::Config#destructive_fields, which previously caused the Mongoid
adapter in Pickle to raise an exception in some cases
f91c6a2
Matt Royal Factory => FactoryGirl to avoid deprication warnings b9a7343
@pivotalpodbay pivotalpodbay Edited pickle.gemspec via GitHub 09b7dcb
@pivotalpodbay pivotalpodbay Specify version of rake so you don't get 0.9.0 by mistake. 37467e7
Collaborator

chewi commented Nov 21, 2014

Not sure if this is still necessary but seems harmless enough. Merged the first commit with a small adjustment.

chewi closed this Nov 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment