8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/changeling/async/trackling.rb', line 8
def async_save_logling
unless defined?(Sidekiq) || defined?(Resque)
raise Changeling::Exceptions::AsyncGemRequired
end
if self.changes && !self.changes.empty?
logling = Changeling::Models::Logling.new(self)
if defined?(Sidekiq)
Changeling::Async::SidekiqWorker.perform_async(logling.to_indexed_json)
elsif defined?(Resque)
Resque.enqueue(Changeling::Async::ResqueWorker, logling.to_indexed_json)
end
end
true
end
|