|
|
@ -125,13 +125,9 @@ class Account < ApplicationRecord
|
|
|
|
|
|
|
|
|
|
|
|
def save_with_optional_avatar!
|
|
|
|
def save_with_optional_avatar!
|
|
|
|
save!
|
|
|
|
save!
|
|
|
|
rescue ActiveRecord::RecordInvalid => invalid
|
|
|
|
rescue ActiveRecord::RecordInvalid
|
|
|
|
if invalid.record.errors[:avatar_file_size] || invalid.record.errors[:avatar_content_type]
|
|
|
|
self.avatar = nil
|
|
|
|
self.avatar = nil
|
|
|
|
save!
|
|
|
|
retry
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
raise invalid
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def avatar_remote_url=(url)
|
|
|
|
def avatar_remote_url=(url)
|
|
|
|