✔️ Rails v6 Upgrade
parent
dbfec00e68
commit
f16014bfd1
|
@ -43,8 +43,6 @@ class Image < ApplicationRecord
|
|||
has_one_attached :attachment
|
||||
|
||||
def set_attachment_by_url(url)
|
||||
# File
|
||||
# URI::HTTPS
|
||||
attachment.attach(io: open(url), filename: "image_#{self.id}")
|
||||
self.attachment_processed_at = Time.now
|
||||
self
|
||||
|
@ -68,11 +66,7 @@ class Image < ApplicationRecord
|
|||
end
|
||||
|
||||
def regular_image?
|
||||
if attachment
|
||||
return attachment.attached?
|
||||
else
|
||||
return false
|
||||
end
|
||||
attachment && attachment.attached?
|
||||
end
|
||||
|
||||
def regular_url
|
||||
|
|
Loading…
Reference in New Issue