Sha256: b2052772565a03bfd05679e0ae2b04d81f938d006664fa56e12fb4a3d18e9b53

Contents?: true

Size: 485 Bytes

Versions: 1

Compression:

Stored size: 485 Bytes

Contents

# frozen_string_literal: true

class CompositeChapter < ActiveRecord::Base
  if ENV['AR_VERSION'].to_f >= 8.0
    belongs_to :composite_book, inverse_of: :composite_chapters,
                                foreign_key: [:composite_book_id, :author_id]
  elsif ENV['AR_VERSION'].to_f >= 7.1
    belongs_to :composite_book, inverse_of: :composite_chapters,
                                query_constraints: [:composite_book_id, :author_id]
  end
  validates :title, presence: true
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-import-2.0.0 test/models/composite_chapter.rb