module Lockbox::ActiveStorageExtensions::AttachedOne

Public Instance Methods

attach(attachable) click to toggle source
Calls superclass method
# File lib/lockbox/active_storage_extensions.rb, line 38
def attach(attachable)
  attachable = encrypt_attachable(attachable) if encrypted?
  super(attachable)
end
rotate_encryption!() click to toggle source
# File lib/lockbox/active_storage_extensions.rb, line 44
def rotate_encryption!
  raise "Not encrypted" unless encrypted?

  attach(Utils.rebuild_attachable(self)) if attached?

  true
end