Feature: Website SDK (#653)
Add SDK functions Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
8
app/jobs/contact_avatar_job.rb
Normal file
8
app/jobs/contact_avatar_job.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class ContactAvatarJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(contact, avatar_url)
|
||||
avatar_resource = LocalResource.new(avatar_url)
|
||||
contact.avatar.attach(io: avatar_resource.file, filename: avatar_resource.tmp_filename, content_type: avatar_resource.encoding)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user