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 record.public_send("#{name}_attachment") end
def attachment record.public_send("#{name}_attachment") end