Sha256: 485333ea4f6ad3ba8fa7e7c992983a0b2da9185fb8f42315d9af8c277d17989e

Contents?: true

Size: 769 Bytes

Versions: 4

Compression:

Stored size: 769 Bytes

Contents

# frozen_string_literal: true

class Categorization < ActiveRecord::Base
  belongs_to :post
  belongs_to :category, counter_cache: true
  belongs_to :named_category, class_name: "Category", foreign_key: :named_category_name, primary_key: :name
  belongs_to :author

  has_many :post_taggings, through: :author, source: :taggings

  belongs_to :author_using_custom_pk,  class_name: "Author", foreign_key: :author_id, primary_key: :author_address_extra_id
  has_many   :authors_using_custom_pk, class_name: "Author", foreign_key: :id,        primary_key: :category_id
end

class SpecialCategorization < ActiveRecord::Base
  self.table_name = "categorizations"
  default_scope { where(special: true) }

  belongs_to :author
  belongs_to :category
end

Version data entries

4 entries across 4 versions & 1 rubygems

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