Sha256: 82a2da218de6174f38e2fdd58ced1ed2a0654f0d70c25f8b9060f4f9a63a7c30

Contents?: true

Size: 575 Bytes

Versions: 4

Compression:

Stored size: 575 Bytes

Contents

module Attachs
  class Railtie < Rails::Railtie

    config.attachs = ActiveSupport::OrderedOptions.new
    config.attachs.presets = {}
    config.attachs.default_presets = []
    config.attachs.default_validations = {}
    config.attachs.base_url = ''
    config.attachs.storage = :local

    initializer 'attachs' do
      ::ActiveRecord::Base.send :include, Attachs::ActiveRecord::Base
      if config.attachs.storage == :s3
        require 'aws-sdk' 
        Attachs::Storages::S3.config = YAML.load_file(Rails.root.join('config', 's3.yml'))
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
attachs-0.3.5 lib/attachs/railtie.rb
attachs-0.3.2 lib/attachs/railtie.rb
attachs-0.3.1 lib/attachs/railtie.rb
attachs-0.3.0 lib/attachs/railtie.rb