Sha256: 9b3fb6f24dc947dd2e8c44a6ae7188be4767fbfe19044935c263d25ee63fc9a4

Contents?: true

Size: 618 Bytes

Versions: 11

Compression:

Stored size: 618 Bytes

Contents

class Department < ActiveRecord::Base
  self.primary_keys = :department_id, :location_id
  has_many :employees,
           # We intentionally redefine primary key for test purposes. #455
           :primary_key =>  [:department_id, :location_id],
           :foreign_key => [:department_id, :location_id]
  has_one :head, :class_name => 'Employee',  :autosave => true, :dependent => :delete,
                 # We intentionally redefine primary key for test purposes. #455
                 :primary_key =>  [:department_id, :location_id],
                 :foreign_key => [:department_id, :location_id]
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
composite_primary_keys-12.0.2 test/fixtures/department.rb
composite_primary_keys-11.3.1 test/fixtures/department.rb
composite_primary_keys-12.0.1 test/fixtures/department.rb
composite_primary_keys-12.0.0 test/fixtures/department.rb
composite_primary_keys-12.0.0.rc5 test/fixtures/department.rb
composite_primary_keys-12.0.0.rc4 test/fixtures/department.rb
composite_primary_keys-12.0.0.rc3 test/fixtures/department.rb
composite_primary_keys-12.0.0.rc2 test/fixtures/department.rb
composite_primary_keys-12.0.0.rc1 test/fixtures/department.rb
composite_primary_keys-11.2.0 test/fixtures/department.rb
composite_primary_keys-11.1.0 test/fixtures/department.rb