Sha256: fed60447cc8f472841fc3d3e71ee076750b2ad4cdbeba0922c92a49b6bafe8d5

Contents?: true

Size: 360 Bytes

Versions: 81

Compression:

Stored size: 360 Bytes

Contents

class Restaurant < ActiveRecord::Base
  self.primary_keys = :franchise_id, :store_id
  has_and_belongs_to_many :suburbs, 
    :foreign_key => [:franchise_id, :store_id],  
    :association_foreign_key => [:city_id, :suburb_id]
  has_and_belongs_to_many :products,
    :foreign_key => [:franchise_id, :store_id],
    :association_foreign_key => :product_id
end

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
composite_primary_keys-14.0.9 test/fixtures/restaurant.rb
composite_primary_keys-14.0.8 test/fixtures/restaurant.rb
composite_primary_keys-13.0.8 test/fixtures/restaurant.rb
composite_primary_keys-14.0.7 test/fixtures/restaurant.rb
composite_primary_keys-14.0.6 test/fixtures/restaurant.rb
composite_primary_keys-13.0.7 test/fixtures/restaurant.rb
composite_primary_keys-13.0.6 test/fixtures/restaurant.rb
composite_primary_keys-14.0.5 test/fixtures/restaurant.rb
composite_primary_keys-13.0.5 test/fixtures/restaurant.rb
composite_primary_keys-13.0.4 test/fixtures/restaurant.rb
composite_primary_keys-14.0.4 test/fixtures/restaurant.rb
composite_primary_keys-14.0.3 test/fixtures/restaurant.rb
composite_primary_keys-13.0.3 test/fixtures/restaurant.rb
composite_primary_keys-14.0.2 test/fixtures/restaurant.rb
composite_primary_keys-13.0.2 test/fixtures/restaurant.rb
composite_primary_keys-14.0.1 test/fixtures/restaurant.rb
composite_primary_keys-9.0.9 test/fixtures/restaurant.rb
composite_primary_keys-11.0.0.rc2 test/fixtures/restaurant.rb
composite_primary_keys-10.0.3 test/fixtures/restaurant.rb
composite_primary_keys-11.0.0.rc1 test/fixtures/restaurant.rb