]> git.openstreetmap.org Git - rails.git/blobdiff - vendor/gems/composite_primary_keys-1.1.0/test/fixtures/product.rb
Freezing composite primary key so that we can apply TomH's patch to it, and that...
[rails.git] / vendor / gems / composite_primary_keys-1.1.0 / test / fixtures / product.rb
diff --git a/vendor/gems/composite_primary_keys-1.1.0/test/fixtures/product.rb b/vendor/gems/composite_primary_keys-1.1.0/test/fixtures/product.rb
new file mode 100644 (file)
index 0000000..5466dca
--- /dev/null
@@ -0,0 +1,7 @@
+class Product < ActiveRecord::Base\r
+       set_primary_keys :id  # redundant\r
+       has_many :product_tariffs, :foreign_key => :product_id\r
+       has_one :product_tariff, :foreign_key => :product_id\r
+\r
+       has_many :tariffs, :through => :product_tariffs, :foreign_key => [:tariff_id, :tariff_start_date]\r
+end\r