Skip to content

Commit

Permalink
Prevent SQL injection
Browse files Browse the repository at this point in the history
Get rid of the raw SQL call "DISTINCT `key`".
  • Loading branch information
saraycp committed Jun 9, 2020
1 parent 466dfee commit 6762423
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/jobs/status_history_rescaler_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def perform
StatusHistory.where('time < ?', maxtime - 365 * 24 * 3600).delete_all
end

keys = StatusHistory.pluck('DISTINCT `key`')
keys = StatusHistory.distinct.pluck(:key)
keys.each do |key|
StatusHistory.transaction do
# first rescale a month old
Expand Down

0 comments on commit 6762423

Please sign in to comment.