1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Install Active Storage extension lazily

Avoid eagerly loading Active Record during app boot. Reinstall the extension when ActiveStorage::Blob is reloaded in dev.
This commit is contained in:
George Claghorn 2018-10-03 22:23:02 -04:00
parent 3b6b70f0bc
commit 1a4a582ddc

View file

@ -12,9 +12,7 @@ module ActionText
end
initializer "action_text.active_storage_extension" do
require "active_storage/blob"
class ActiveStorage::Blob
ActiveSupport.on_load(:active_storage_blob) do
include ActionText::Attachable
def previewable_attachable?