Sha256: 8c9e2c31b7f49a2f2c8be8cb0283c7e5271d70916536bff8945d45152937fd27

Contents?: true

Size: 552 Bytes

Versions: 2

Compression:

Stored size: 552 Bytes

Contents

module RailsUploads
  class Railtie < Rails::Railtie

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

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

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_uploads-0.2.1 lib/rails_uploads/railtie.rb
rails_uploads-0.2.0 lib/rails_uploads/railtie.rb