-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Labels
Description
Hi,
I tried this snippet of code as suggested in the readme for enqueuing Algolia operations :
class Contact < ActiveRecord::Base
include AlgoliaSearch
algoliasearch enqueue: :trigger_delayed_job do
attribute :first_name, :last_name, :email
end
def self.trigger_delayed_job(record, remove)
if remove
record.delay.remove_from_index!
else
record.delay.index!
end
end
end
My application is running rails 3.2.22 with ruby 2.2.2 and DelayedJob 4.0.6
Without delayed job, the auto_remove works perfectly fine.
However, when I try to remove the project with the enqueuing system set, I get the following error :
ArgumentError:
job cannot be created for non-persisted record:
after further research, I found this DJ related issue : collectiveidea/delayed_job#820
Is there any workaround to this, since I want to remove my model asynchronously from Algolia only after my project has been deleted
denisjacquemin and fkoessler