lib/lockbox/railtie.rb in lockbox-0.6.2 vs lib/lockbox/railtie.rb in lockbox-0.6.3

- old
+ new

@@ -17,10 +17,17 @@ end ActiveStorage::Attached::One.prepend(Lockbox::ActiveStorageExtensions::AttachedOne) ActiveStorage::Attached::Many.prepend(Lockbox::ActiveStorageExtensions::AttachedMany) # use load hooks when possible - if ActiveStorage::VERSION::MAJOR >= 6 + if ActiveStorage::VERSION::MAJOR >= 7 + ActiveSupport.on_load(:active_storage_attachment) do + prepend Lockbox::ActiveStorageExtensions::Attachment + end + ActiveSupport.on_load(:active_storage_blob) do + prepend Lockbox::ActiveStorageExtensions::Blob + end + elsif ActiveStorage::VERSION::MAJOR >= 6 ActiveSupport.on_load(:active_storage_attachment) do include Lockbox::ActiveStorageExtensions::Attachment end ActiveSupport.on_load(:active_storage_blob) do prepend Lockbox::ActiveStorageExtensions::Blob