Adding :uploaddatetime because it is mentioned in the default scope
This commit is contained in:
parent
07bd3a6abc
commit
39149c26ad
1 changed files with 1 additions and 1 deletions
|
|
@ -17,7 +17,7 @@ namespace :debshots do
|
|||
|
||||
loop do
|
||||
destroyed = 0
|
||||
Screenshot.select(:package_id, :image_fingerprint).group(:package_id, :image_fingerprint).having("count(*) > 1").each do |ss|
|
||||
Screenshot.select(:package_id, :image_fingerprint).group(:package_id, :image_fingerprint, :uploaddatetime).having("count(*) > 1").each do |ss|
|
||||
# Look again for screenshots of this fingerprint.
|
||||
# This extra step may seem stupid but the above query lead to package_id=NULL results sometimes.
|
||||
del = Screenshot.find_by(image_fingerprint: ss.image_fingerprint)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue