summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorPeter Leitzen <pleitzen@gitlab.com>2019-01-08 21:24:55 +0100
committerPeter Leitzen <pleitzen@gitlab.com>2019-01-08 21:24:55 +0100
commit00092387ef855dbd28a3514ed85212344a8be5ed (patch)
tree68878ab577683c761167e729a194ae412d90e681 /app/workers
parent1b3affafab0f28c690ce93cc98ac6bd09cbda59f (diff)
downloadgitlab-ce-00092387ef855dbd28a3514ed85212344a8be5ed.tar.gz
Use record's primary key instead of hardcoded `id`
Enable caching for records which primary key is not `id`.
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/reactive_caching_worker.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/workers/reactive_caching_worker.rb b/app/workers/reactive_caching_worker.rb
index 96ff8cd6222..7c66ac046ea 100644
--- a/app/workers/reactive_caching_worker.rb
+++ b/app/workers/reactive_caching_worker.rb
@@ -12,7 +12,7 @@ class ReactiveCachingWorker
end
return unless klass
- klass.find_by(id: id).try(:exclusively_update_reactive_cache!, *args)
+ klass.find_by(klass.primary_key => id).try(:exclusively_update_reactive_cache!, *args)
end
# rubocop: enable CodeReuse/ActiveRecord
end