teja
Joined
50 Experience
0 Lessons Completed
0 Questions Solved
Activity
How can I write the following code in better way
if author.present?
Article.where(category: params[:category], author_id: author.id)
else
Article.where(category: params[:category])
end