How do I add a limit
to this scope?
scope :with_comments, include: {comments: :user}
I'm using it like this:
Event.with_comments.find(params[:id])
How do I add a limit
to this scope?
scope :with_comments, include: {comments: :user}
I'm using it like this:
Event.with_comments.find(params[:id])
default_scope includes(:comments :user).limit(5)
Add it to default scope
Event.find(params[:id])