Sha256: 64c5890f9ceb3f83401bb7e9fd154b16ab1cf78a816fda9947754aca30ff0203
Contents?: true
Size: 409 Bytes
Versions: 34
Compression:
Stored size: 409 Bytes
Contents
module Virgo class Post < ActiveRecord::Base module Recommendations extend ActiveSupport::Concern included do def recommendations if post_tags.any? Post.where.not(id: id).joins(:tags).where("virgo_post_tags.tag_id IN (?)", post_tags.pluck(:tag_id)).uniq.order(created_at: :desc).by_similarity_to(headline) end end end end end end
Version data entries
34 entries across 34 versions & 1 rubygems