correct emergency regeneration in the controller

This commit is contained in:
Sam
2015-05-06 07:33:32 +10:00
parent 2625c3bb9a
commit 0f53fc8328
3 changed files with 6 additions and 3 deletions

View File

@ -12,7 +12,9 @@ class StylesheetCache < ActiveRecord::Base
count = StylesheetCache.count
if count > MAX_TO_KEEP
remove_lower = StylesheetCache.limit(MAX_TO_KEEP)
remove_lower = StylesheetCache
.where(target: target)
.limit(MAX_TO_KEEP)
.order('id desc')
.pluck(:id)
.last