aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_text/engine.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/active_text/engine.rb')
-rw-r--r--lib/active_text/engine.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/active_text/engine.rb b/lib/active_text/engine.rb
index 5b16acab04..9a1d08e1ad 100644
--- a/lib/active_text/engine.rb
+++ b/lib/active_text/engine.rb
@@ -11,6 +11,18 @@ module ActiveText
end
end
+ initializer "active_text.active_storage_extension" do
+ require "active_storage/blob"
+
+ class ActiveStorage::Blob
+ include ActiveText::Attachable
+
+ def previewable_attachable?
+ representable?
+ end
+ end
+ end
+
# FIXME: Aren't helpers supposed to load automatically?
# https://github.com/rails/rails/issues/26627 ?
initializer "active_text.helper" do