karmi / retire

A rich Ruby API and DSL for the Elasticsearch search engine
http://karmi.github.com/retire/
MIT License
1.86k stars 533 forks source link

Edge case for respond_to? when serializing items #944

Closed fabn closed 10 years ago

fabn commented 10 years ago

I found an issue with class Tire::Result::Item when the object is serialized. The current version cannot be deserialized by (for instance) Psych, since it uses Class#allocate instead of 'Class#new`.

In that case #initialize is not called and @attributes is nil.

Hope this will get merged.

karmi commented 10 years ago

Thanks!, merged the respond_to? fix.