, , , has_posted? ?
.
.includes(), , N + 1. N . .includes() post . , , ... has_posted? posts.any?.
UPDATE
, ! , ruby. :
class User
def has_posted?
posts.is_posted.any?
end
end
class Post
scope :is_posted, -> { where(posted: true) }
end
, , posted true. .any? COUNT ! ( , .)