Sha256: 1c54e7675e1c6c0eb18c2fc7fc8c0acb28422177aedce6fc6ab7556a4b6356aa

Contents?: true

Size: 478 Bytes

Versions: 7

Compression:

Stored size: 478 Bytes

Contents

class Employee < ActiveRecord::Base
	belongs_to :department, :foreign_key => [:department_id, :location_id]
	has_many :comments, :as => :person
	has_and_belongs_to_many :groups
        has_many :salaries,
          :primary_key => [:id, :location_id],
          :foreign_key => [:employee_id, :location_id]
        has_one :one_salary, :class_name => "Salary",
          :primary_key => [:id, :location_id],
          :foreign_key => [:employee_id, :location_id]
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
composite_primary_keys-8.1.5 test/fixtures/employee.rb
composite_primary_keys-8.1.4 test/fixtures/employee.rb
composite_primary_keys-9.0.0 test/fixtures/employee.rb
composite_primary_keys-9.0.0.beta1 test/fixtures/employee.rb
composite_primary_keys-8.1.3 test/fixtures/employee.rb
composite_primary_keys-8.1.2 test/fixtures/employee.rb
composite_primary_keys-8.1.1 test/fixtures/employee.rb