You should use includes method, like in following:
Article.includes(:comments).where(title: 'Sample text')
For your first case, you don't really need eager loading, since you only select one record, so this is not n+1 problem. You can just do:
article = Article.find(1)
article.comments
If you use include your articles frequently, you may define scope:
scope :with_comments, -> { includes(:comments }
and simply call it:
Article.with_comments.where(title: 'Sample text')
When your relation into which you want to include comments
comes from another association, nothing changes, you can do both:
@current_user.articles.includes(:comments)
and
@current_user.articles.with_comments