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_vault/railtie.rb
David Heinemeier Hansson 3c9a28d6e4 Fix configuration names
2017-07-05 16:10:03 +02:00

27 lines
678 B
Ruby

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