2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

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