@@ -62,7 +62,7 @@ class Attachment < ApplicationRecord
|
||||
|
||||
def thumb_url
|
||||
if file.attached? && file.representable?
|
||||
url_for(file.representation(resize: '250x250'))
|
||||
url_for(file.representation(resize_to_fill: [250, nil]))
|
||||
else
|
||||
''
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ module Avatarable
|
||||
end
|
||||
|
||||
def avatar_url
|
||||
return url_for(avatar.representation(resize: '250x250')) if avatar.attached? && avatar.representable?
|
||||
return url_for(avatar.representation(resize_to_fill: [250, nil])) if avatar.attached? && avatar.representable?
|
||||
|
||||
''
|
||||
end
|
||||
|
||||
@@ -10,7 +10,7 @@ module Pubsubable
|
||||
|
||||
def pubsub_token
|
||||
# backfills tokens for existing records
|
||||
regenerate_pubsub_token if self[:pubsub_token].blank?
|
||||
regenerate_pubsub_token if self[:pubsub_token].blank? && persisted?
|
||||
self[:pubsub_token]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user