Use association on post flags instead of doing a new query
- Because associations can be preloaded in the controller
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user