require 'dragonfly' # Configure Dragonfly.app.configure do plugin :imagemagick protect_from_dos_attacks true secret "077bf7a27fa26210595c6df46a389b20a3f94e9338918eeb6dea617a7387f7d5" url_format "/media/:job/:name" datastore :file, root_path: Rails.root.join('public/system/dragonfly', Rails.env), server_root: Rails.root.join('public') end # Logger Dragonfly.logger = Rails.logger # Mount as middleware Rails.application.middleware.use Dragonfly::Middleware # Add model functionality if defined?(ActiveRecord::Base) ActiveRecord::Base.extend Dragonfly::Model ActiveRecord::Base.extend Dragonfly::Model::Validations end