Sha256: 17d07280d1aa0dfdd85d56cf662c53899f7981f499b3824a82dc91542937cf03

Contents?: true

Size: 311 Bytes

Versions: 6

Compression:

Stored size: 311 Bytes

Contents

class Product < ActiveRecord::Base
	set_primary_keys :id  # redundant
	has_many :product_tariffs, :foreign_key => :product_id, :dependent => :delete_all
	has_one :product_tariff, :foreign_key => :product_id

	has_many :tariffs, :through => :product_tariffs, :foreign_key => [:tariff_id, :tariff_start_date]
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
composite_primary_keys-3.1.6 test/fixtures/product.rb
composite_primary_keys-3.1.5 test/fixtures/product.rb
composite_primary_keys-3.1.4 test/fixtures/product.rb
composite_primary_keys-3.1.2 test/fixtures/product.rb
composite_primary_keys-3.1.1 test/fixtures/product.rb
composite_primary_keys-3.1.0 test/fixtures/product.rb