Sunday, August 06, 2017

Find all articles that is not tagged in Rails


ids = Tagging.where(taggable_type: "Article").collect(&:taggable_id).uniq

Article.where.not(id: ids).collect(&:id)