I am trying to upgrade my app to mongoid version 3. In my dragonfly initializer I used to have this:

app.configure_with(:imagemagick)
app.configure_with(:rails) do |c|
  c.datastore = Dragonfly::DataStorage::MongoDataStore.new :db => Mongoid.database
end

Mongoid.database no longer exists. What is the best way to configure the connection for dragonfly now?

有帮助吗?

解决方案

I use Mongoid.load!("config/mongoid.yml", :development) instead of Mongoid.database. And it's works for me.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top