rewind io before reading to allow multiple read
This commit is contained in:
parent
bc4dc22aea
commit
38a5847ca4
1 changed files with 8 additions and 2 deletions
|
@ -94,7 +94,10 @@ class BillSignature < ApplicationRecord
|
|||
def read_signature
|
||||
if attachment_changes['signature']
|
||||
io = io_for_changes(attachment_changes['signature'])
|
||||
io.read if io.present?
|
||||
if io.present?
|
||||
io.rewind
|
||||
io.read
|
||||
end
|
||||
elsif signature.attached?
|
||||
signature.download
|
||||
end
|
||||
|
@ -103,7 +106,10 @@ class BillSignature < ApplicationRecord
|
|||
def read_serialized
|
||||
if attachment_changes['serialized']
|
||||
io = io_for_changes(attachment_changes['serialized'])
|
||||
io.read if io.present?
|
||||
if io.present?
|
||||
io.rewind
|
||||
io.read
|
||||
end
|
||||
elsif serialized.attached?
|
||||
serialized.download
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue