2016-12-16 23:09:50 -05:00
|
|
|
class ReactiveCachingWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2016-12-16 23:09:50 -05:00
|
|
|
|
2017-01-12 17:31:02 -05:00
|
|
|
def perform(class_name, id, *args)
|
2016-12-16 23:09:50 -05:00
|
|
|
klass = begin
|
|
|
|
Kernel.const_get(class_name)
|
|
|
|
rescue NameError
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
return unless klass
|
|
|
|
|
2017-01-12 17:31:02 -05:00
|
|
|
klass.find_by(id: id).try(:exclusively_update_reactive_cache!, *args)
|
2016-12-16 23:09:50 -05:00
|
|
|
end
|
|
|
|
end
|