How to?: Mongoid 3 and Dragonfly configuration
-
01-07-2021 - |
Pergunta
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?
Solução
I use Mongoid.load!("config/mongoid.yml", :development)
instead of Mongoid.database
. And it's works for me.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow