My application is a refineryCMS which is been hosted on the heroku server . I need to store the images on the postgres DB store. I got one gem dragonfly-activerecord , but not able to keep it on database . I tried:
Configure Dragonfly itself (in config/initializers/dragonfly.rb, typically):
require 'dragonfly-activerecord/store'
Dragonfly.app.configure do
# ... your existing configuration here
datastore Dragonfly::ActiveRecord::Store.new
We need to integrate this gem into refineryCMS.. If we can store images in database for cms that will be great help for host like heroku.
Here is a solution along with the dragonfly-activerecord fork . Just go to
config/initializers/refinery/images.rbHere is a code to do it. First follow dragonfly-activerecord fork stepsIn Gemfile:
gem 'dragonfly-activerecord' , git: "git://github.com/arpit-clarion/dragonfly-activerecord.git"andbundlerails generate migration add_dragonfly_storageIn the migration file add this code
Run
rake db:migrateand add this code:This will change the whole system folder structure set into database. No need to any buckets .
Keep in mind that this system is for those applications which has less images to store as it generates big chunks in db and it converts images on request time.