diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2019-01-08 21:24:55 +0100 |
---|---|---|
committer | Peter Leitzen <pleitzen@gitlab.com> | 2019-01-08 21:24:55 +0100 |
commit | 00092387ef855dbd28a3514ed85212344a8be5ed (patch) | |
tree | 68878ab577683c761167e729a194ae412d90e681 /app/workers | |
parent | 1b3affafab0f28c690ce93cc98ac6bd09cbda59f (diff) | |
download | gitlab-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.rb | 2 |
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 |