Hey all
Im trying to get has_many :through relationship working, as i head its
better and more robust that HABTM.
I have the following tables/objects…
class Currency < ActiveRecord::Base
has_many :product_prices
has_many :products, :through => :product_prices
end
class Product < ActiveRecord::Base
has_many :product_prices
has_many :currencies, :through => :product_prices
end
class ProductPrice < ActiveRecord::Base
belongs_to :product
belongs_to :currency
end
Is that the correct configuration for what is effectivly a HABTM
relationship? If not could somone please point me in the right
direction!!
Furthermore, if i wanted to submit data into the product prices
table/object, how would i do that? The same was as any other commit?
Object.new(params[:object]) ?
Cheers all
Tim