Use association on post flags instead of doing a new query

- Because associations can be preloaded in the controller
This commit is contained in:
BrokenEagle
2020-02-12 23:55:27 +00:00
parent 75f4af8991
commit e807326372
2 changed files with 106 additions and 1 deletions

View File

@@ -155,7 +155,7 @@ class PostFlag < ApplicationRecord
end
def uploader_id
@uploader_id ||= Post.find(post_id).uploader_id
post.uploader_id
end
def not_uploaded_by?(userid)