mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
27 lines
678 B
Ruby
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
|