JSON and ActiveRecord

5 views
Skip to first unread message

Devlin Daley

unread,
Apr 1, 2009, 12:27:14 AM4/1/09
to CloudKit
This is just a note, informational only, as I seem to have found a
workaround.

I'm using Cloudkit, in particular the OpenID Filter in a Sinatra app.
I've recently started using ActiveRecord in this app, and discovered
that the CloudKit OpenID Filter stopped working.

ActiveRecord depends on ActiveSupport. Both ActiveSupport and the JSON
gem (that CloudKit uses) define a to_json method on most objects, like
Hash, that are not always compatible.

It's a case where the last library to get "required' wins the battle
over defining to_json.

I was able to require ActiveRecord before CloudKit, so that CloudKit
and the JSON gem "win" and CloudKit can successfully save and query
its own data store. My ActiveRecord models still pass all their tests
so hopefully this is a sufficient workaround.

-- Devlin
Reply all
Reply to author
Forward
0 new messages