Sha256: 000ef5124b296d26dae69ce263ff23091a3aaa56dd7766a8b296d310faf0d45c

Contents?: true

Size: 528 Bytes

Versions: 2

Compression:

Stored size: 528 Bytes

Contents

# frozen_string_literal: true

class Book < ActiveRecord::Base
  belongs_to :topic, inverse_of: :books
  if ENV['AR_VERSION'].to_f <= 7.0
    belongs_to :tag, foreign_key: [:tag_id, :parent_id] unless ENV["SKIP_COMPOSITE_PK"]
  else
    belongs_to :tag, query_constraints: [:tag_id, :parent_id] unless ENV["SKIP_COMPOSITE_PK"]
  end
  has_many :chapters, inverse_of: :book
  has_many :discounts, as: :discountable
  has_many :end_notes, inverse_of: :book
  enum status: [:draft, :published] if ENV['AR_VERSION'].to_f >= 4.1
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activerecord-import-1.8.1 test/models/book.rb
activerecord-import-1.8.0 test/models/book.rb