Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

New mongoid #49

Closed
swistaczek opened this Issue Jul 26, 2012 · 6 comments

Comments

Projects
None yet
4 participants

Hi,
I am trying to set carierwave with Mongoid but in new wersion Mongoid.database is undefined. What is new name of Mongoid.database method?

hilios commented Jul 26, 2012

Now the Mongoid uses Moped for opening mongo sessions, there are new features that allow you to connect to multiple database at the same time, or even a cluster, so the object is more abstract than was before, and holds multiple host information.

Said that my best try in this issue is:

CarrierWave.configure do |config|
  config.grid_fs_database = Mongoid::Config.sessions[:default][:database]
  config.grid_fs_host     = Mongoid::Config.sessions[:default][:hosts].first
  config.storage :grid_fs
end

Let's see what the guys from carrierwave says about my conf. But hope that helps you.

nvdk commented Sep 18, 2012

Mongoid 3 (or rather their mongodb driver, moped) does not support gridfs, see http://mongoid.org/en/mongoid/docs/upgrading.html

Member

rmm5t commented Sep 18, 2012

@nvdk carrierwave-mongoid uses moped-gridfs via the mongoid-3.0 branch. For now, that looks like this in your Gemfile:

gem "carrierwave-mongoid", :git => "git://github.com/jnicklas/carrierwave-mongoid.git", :branch => "mongoid-3.0"

nvdk commented Sep 18, 2012

Ah cool didn't know that, thanks :)

hilios commented Sep 20, 2012

Thats great, guys! Thanks

Member

rmm5t commented Jan 15, 2013

Triaging. Closing this out now that carrierwave-mongoid 0.3.0 is out. It supports Mongoid 3.0 and no longer needs the grid_fs_xxx config options.

@rmm5t rmm5t closed this Jan 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment