Sha256: 75d4311b22a40be61333f41eabeada0493560ce7bd3617822833c65b0dd967ef

Contents?: true

Size: 805 Bytes

Versions: 1

Compression:

Stored size: 805 Bytes

Contents

require 'rails'
require 'uploader'

module Uploader
  class Engine < ::Rails::Engine
    isolate_namespace Uploader

    initializer 'uploader.assets_precompile' do |app|
      app.config.assets.precompile += Uploader.assets
    end

    initializer 'uploader.helpers' do
      ActiveSupport.on_load :action_view do
        ActionView::Base.send(:include, Uploader::Helpers::FormTagHelper)
        ActionView::Helpers::FormBuilder.send(:include, Uploader::Helpers::FormBuilder)
      end
    end

    initializer 'uploader.hooks' do
      require 'uploader/hooks/active_record' if Object.const_defined?('ActiveRecord')
      require 'uploader/hooks/simple_form'   if Object.const_defined?('SimpleForm')
      require 'uploader/hooks/formtastic'    if Object.const_defined?('Formtastic')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-uploader-0.2.8 lib/uploader/engine.rb