crack icon indicating copy to clipboard operation
crack copied to clipboard

Crack breaks Mongoid by adding #attributes method to the String class

Open zdennis opened this issue 13 years ago • 2 comments

Crack adds the #attributes method to the String class when parsing xml which conflicts with Mongoid as Mongoid uses respond_to?(:attributes) when determining whether to load associations.

Crack should likely not be adding #attributes to String. It should use a wrapper class or a subclass if it needs to modify core classes with something library specific.

zdennis avatar Jan 27 '11 17:01 zdennis

The issue can be seen in this commit:

https://github.com/jnunemaker/crack/commit/be463a10929cc8acea1328fb8b47f9f73e3645f3

zdennis avatar Jan 27 '11 17:01 zdennis

Not yet pulled in, but fixed by a patch here that hasn't been pulled in https://github.com/jnunemaker/crack/pull/25 & by a mongoid patch here https://github.com/mongoid/mongoid/issues/618 that hasn't been pulled either

marcusmateus avatar Jul 21 '11 00:07 marcusmateus

It seems to be fixed already. Feel free to reopen the issue if you think otherwise

kiskoza avatar Jan 26 '24 17:01 kiskoza