Module: Lockbox::ActiveStorageExtensions::AttachedMany
- Defined in:
- lib/lockbox/active_storage_extensions.rb
Instance Method Summary collapse
Instance Method Details
#rotate_encryption! ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/lockbox/active_storage_extensions.rb', line 47 def rotate_encryption! raise "Not encrypted" unless encrypted? # must call to_a - do not change = .to_a attachables = .map do || Utils.rebuild_attachable() end ActiveStorage::Attachment.transaction do attach(attachables) .each(&:purge) end .reload true end |