I am trying to filter my posts and I grab them using this query.
@posts = Post.all.includes(:course).where("courses.name IN (#{@user.courses.map(&:name).collect { |s| "'#{s}'" }.join(',') })").references(:course).order("posts.created_at DESC")
I am not familiar with postgresql and know there are some differences. How do I change this to query in postgres?