Closed
Description
Getting
ERROR: ActiveRecord::NotNullViolation: PG::NotNullViolation: ERROR: null value in column "service_name" violates not-null constraint
When calling .attach(io: File.open('/path/to/file'), filename: 'file.pdf')
from Worker
Worker is called using .perform_async
CODE:
class User < ApplicationRecord
has_one_attached :avatar
end
user.avatar.attach(io: File.open('/path/to/file'), filename: 'file.pdf')
user.avatar.attach is called from sidekiq worker
Getting
ERROR: ActiveRecord::NotNullViolation: PG::NotNullViolation: ERROR: null value in column "service_name" violates not-null constraint
System configuration
Rails version: 6.1.4:
Ruby version: 2.5.0: