riak-ripple / ripple

A rich Ruby modeling layer for Riak, Basho's distributed database
Other
618 stars 152 forks source link

Gracefully handle conflicts for non-Ripple (riak-client) data #291

Open tpjg opened 12 years ago

tpjg commented 12 years ago

Sorry for another three line pull request. My application is mostly using Ripple, however some data is handled directly using riak-client. There is no ['_type'] data for documents that are handled with the riak-client only. This small patch allows for conflicting data (allow_mult=true) and resolving it in riak-client only.

tpjg commented 12 years ago

Diff to original is now a single line and not using 'rescue'. It simply checks if the content_type=='application/json' before trying to determine the model.

jmlacroix commented 12 years ago

The latest patch fixed the problem for me.