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
1 changed files with 1 additions and 3 deletions

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?