1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/lib/active_storage/railtie.rb
David Heinemeier Hansson c624df326a ActiveVault -> ActiveStorage
Yaroslav agreed to hand over the gem name ❤️
2017-07-06 11:33:29 +02:00

27 lines
696 B
Ruby

require "rails/railtie"
module ActiveStorage
class Railtie < Rails::Railtie # :nodoc:
config.active_storage = ActiveSupport::OrderedOptions.new
config.eager_load_namespaces << ActiveStorage
initializer "active_storage.routes" do
require "active_storage/disk_controller"
config.after_initialize do |app|
app.routes.prepend do
get "/rails/blobs/:encoded_key" => "active_storage/disk#show", as: :rails_disk_blob
end
end
end
initializer "active_storage.attached" do
require "active_storage/attached"
ActiveSupport.on_load(:active_record) do
extend ActiveStorage::Attached::Macros
end
end
end
end