Sha256: 2cfee992bbe728b8f6791c1a8e8e418238eff3fbd8baf57f34de52c6bbe255e7

Contents?: true

Size: 418 Bytes

Versions: 4

Compression:

Stored size: 418 Bytes

Contents

# frozen_string_literal: true

class Rating < ActiveRecord::Base
  belongs_to :comment
  has_many :taggings, as: :taggable
  has_many :taggings_without_tag, -> { left_joins(:tag).where("tags.id": [nil, 0]) }, as: :taggable, class_name: "Tagging"
  has_many :taggings_with_no_tag, -> { joins("LEFT OUTER JOIN tags ON tags.id = taggings.tag_id").where("tags.id": nil) }, as: :taggable, class_name: "Tagging"
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ibm_db-5.5.0-x86-mingw32 test/models/rating.rb
ibm_db-5.4.1-x86-mingw32 test/models/rating.rb
ibm_db-5.4.0-x86-mingw32 test/models/rating.rb
ibm_db-5.3.2-x86-mingw32 test/models/rating.rb