-
Notifications
You must be signed in to change notification settings - Fork 198
Open
Description
record(param)&.update!(params(param)) || RecordClass.create!(params(param))
def record(param)
RecordClass.find_by(
field1: 'a',
field2: 'b',
field3: 'c',
field4: [param]
)
end
I have a background job to create or update a record, as I have given in the example above, the code is something like that but the thing is when the data is always created even if the data exists in the database.
NOTE: for first few jobs, it updates but suddenly the data starts to get created
but once I change the job to perform now, the data is updated
I use mongoid, solid queue
Metadata
Metadata
Assignees
Labels
No labels