Sha256: 3eac1dd1e3750bebebbb5023cf945ada16296f5cca7477915e3f42b2712f64c0

Contents?: true

Size: 634 Bytes

Versions: 5

Compression:

Stored size: 634 Bytes

Contents

require 'rack/cache'
require 'dragonfly'

app = Dragonfly[:images]
app.configure_with(:imagemagick)
app.configure_with(:rails)

if defined? ActiveRecord::Base
  app.define_macro(ActiveRecord::Base, :image_accessor)
end

if defined? Mongoid::Document
  require 'mongoid'

  mongo_yml_path  = Rails.env.test? ? "#{File.expand_path('../../../../test/dummy/config', __FILE__)}" : "config"
  db              = YAML.load_file(File.join(mongo_yml_path, 'mongoid.yml'))[Rails.env]['database']
  app.datastore   = Dragonfly::DataStorage::MongoDataStore.new :database => db

  app.define_macro_on_include(Mongoid::Document, :image_accessor)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
attachment_magick-0.2.3 lib/attachment_magick/dragonfly/init.rb
attachment_magick-0.2.2 lib/attachment_magick/dragonfly/init.rb
attachment_magick-0.2.1 lib/attachment_magick/dragonfly/init.rb
attachment_magick-0.2.0 lib/attachment_magick/dragonfly/init.rb
attachment_magick-0.1.0 lib/attachment_magick/dragonfly/init.rb