class ActiveStorage::Attached::One
def attachment
You don't have to call this method to access the attachment's methods as
Returns the associated attachment record.
def attachment change.present? ? change.attachment : record.public_send("#{name}_attachment") end