Use record's primary key instead of hardcoded id
Enable caching for records which primary key is not `id`.
This commit is contained in:
parent
1b3affafab
commit
00092387ef
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue