use preloaded tags to save 1 + n queries
This commit is contained in:
parent
59bb7b5b42
commit
dd2e74f63a
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue