Reputation: 6579
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])
Upvotes: 0
Views: 152
Reputation: 11876
default_scope includes(:comments :user).limit(5)
Add it to default scope
Event.find(params[:id])
Upvotes: 0