aboutsummaryrefslogblamecommitdiffstats
path: root/lib/active_file/railtie.rb
blob: 18e477922933bd0d88d75e5d847e505be1b43f2d (plain) (tree)
1
2
3
4
5
6
7
8
9
                       

                 
                                          
                                                          


                                              
                                       



                                           
                                                                                          


           

     
require "rails/railtie"

module ActiveFile
  class Railtie < Rails::Railtie # :nodoc:
    config.action_file = ActiveSupport::OrderedOptions.new

    config.eager_load_namespaces << ActiveFile

    initializer "action_file.routes" do
      require "active_file/disk_controller"

      config.after_initialize do |app|
        app.routes.prepend do
          get "/rails/blobs/:encoded_key" => "active_file/disk#show", as: :rails_disk_blob
        end
      end
    end
  end
end