jnicklas/carrierwave — Issue #606: JSON serialization is broken on mongoid
Author: karb
Created: 2012-02-02 12:24:32+00:00
State: open

I think commit 9e869ae broke the serialization of Mongoid models with a carrierwave uploader mounted.
It throws the following when trying to render the .json

ActiveSupport::JSON::Encoding::CircularReferenceError in Advertising::BrandsController#show
object references itself

When I use the stable gem all is fine; when I run master it breaks. Test case:

Gemfile

gem 'carrierwave', git: "git://github.com/jnicklas/carrierwave.git"
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'

Mount Uploader on Model, try to render JSON for that model.