Sha256: 881824910b3ea59ff9580833b6e2ed10d56cdf34069bf4fba4c4c163ac2c45c2

Contents?: true

Size: 282 Bytes

Versions: 9

Compression:

Stored size: 282 Bytes

Contents

class Department < ActiveRecord::Base
  self.primary_keys = :department_id, :location_id
  has_many :employees, :foreign_key => [:department_id, :location_id]
  has_one :head, :class_name => 'Employee', :foreign_key => [:department_id, :location_id], :dependent => :delete
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
composite_primary_keys-8.1.8 test/fixtures/department.rb
composite_primary_keys-8.1.7 test/fixtures/department.rb
composite_primary_keys-11.0.3 test/fixtures/department.rb
composite_primary_keys-11.0.2 test/fixtures/department.rb
composite_primary_keys-10.0.5 test/fixtures/department.rb
composite_primary_keys-9.0.10 test/fixtures/department.rb
composite_primary_keys-11.0.1 test/fixtures/department.rb
composite_primary_keys-11.0.0 test/fixtures/department.rb
composite_primary_keys-10.0.4 test/fixtures/department.rb