Add rubocop to our build. (#5004)

This commit is contained in:
Guo Xiang Tan
2017-07-28 10:20:09 +09:00
committed by GitHub
parent ff4e295c4f
commit 5012d46cbd
871 changed files with 5480 additions and 6056 deletions

View File

@ -3,7 +3,7 @@ class StylesheetCache < ActiveRecord::Base
MAX_TO_KEEP = 50
def self.add(target,digest,content,source_map)
def self.add(target, digest, content, source_map)
return false if where(target: target, digest: digest).exists?
@ -13,11 +13,11 @@ class StylesheetCache < ActiveRecord::Base
if count > MAX_TO_KEEP
remove_lower = StylesheetCache
.where(target: target)
.limit(MAX_TO_KEEP)
.order('id desc')
.pluck(:id)
.last
.where(target: target)
.limit(MAX_TO_KEEP)
.order('id desc')
.pluck(:id)
.last
exec_sql("DELETE FROM stylesheet_cache where id < :id", id: remove_lower)
end