use preloaded tags to save 1 + n queries

This commit is contained in:
Peter Bhat Harkins 2020-08-28 08:40:11 -05:00
parent 59bb7b5b42
commit dd2e74f63a
1 changed files with 1 additions and 4 deletions

View File

@ -385,10 +385,7 @@ class Story < ApplicationRecord
return false
end
if self.taggings.select {|t| t.tag && t.tag.privileged? }.any?
return false
end
self.tags.each {|t| return false if t.privileged? }
return true
end