Sha256: ad0c0fd632ca507f0c22e79cdebab0c30305ddc5e53db2e98b21681d6099f4a2

Contents?: true

Size: 769 Bytes

Versions: 2

Compression:

Stored size: 769 Bytes

Contents

if defined?(Rails)
  module S3Multipart
    class Railtie < Rails::Railtie

      initializer "s3_multipart.action_view" do 
        ActiveSupport.on_load :action_view do
          require 's3_multipart/action_view_helpers/form_helper'
        end
      end

      # Load all of the upload controllers in app/uploaders/multipart
      initializer "s3_multipart.load_upload_controllers" do
        begin
          uploaders = Dir.entries(Rails.root.join('app', 'uploaders', 'multipart').to_s).keep_if {|n| n =~ /[uploader]/}
          uploaders.each do |uploader|
            require "#{Rails.root.join('app', 'uploaders', 'multipart')}/#{uploader}"
          end
        rescue
          # Give some sort of error in the console
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
s3_multipart-0.0.7 lib/s3_multipart/railtie.rb
s3_multipart-0.0.6 lib/s3_multipart/railtie.rb