Sha256: 9f7f51948ed388e81564d2f4835285e5b2fffa2d981a0431449e0fe36bd688f3
Contents?: true
Size: 586 Bytes
Versions: 2
Compression:
Stored size: 586 Bytes
Contents
# frozen_string_literal: true class CompositeBook < ActiveRecord::Base self.primary_key = %i[id author_id] belongs_to :author if ENV['AR_VERSION'].to_f <= 7.0 || ENV['AR_VERSION'].to_f >= 8.0 unless ENV["SKIP_COMPOSITE_PK"] has_many :composite_chapters, inverse_of: :composite_book, foreign_key: [:id, :author_id] end else has_many :composite_chapters, inverse_of: :composite_book, query_constraints: [:id, :author_id] end def self.sequence_name "composite_book_id_seq" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
activerecord-import-2.1.0 | test/models/composite_book.rb |
activerecord-import-2.0.0 | test/models/composite_book.rb |