--- /dev/null
+class Tariff < ActiveRecord::Base\r
+ set_primary_keys [:tariff_id, :start_date]\r
+ has_many :product_tariffs, :foreign_key => [:tariff_id, :tariff_start_date]\r
+ has_one :product_tariff, :foreign_key => [:tariff_id, :tariff_start_date]\r
+ has_many :products, :through => :product_tariffs, :foreign_key => [:tariff_id, :tariff_start_date]\r
+end\r