As Matthew Lehner pointed out, having Metric be its own table is an unnecessary abstraction. The product and the unit (what you call metric--which is a misnomer, I believe, and leading you down the wrong path), can live together in the same table. There is no point in allowing the units vary independently of product. Each product is measured in a specific unit that's immutable. For example, product A may be measured by weight, product B by volume and product C by length. It wouldn't make any sense at all to allow the flexibility to measure product A in any unit other than weight, and having this flexibility could be, in fact, a source unintended errors: If the units live in a separate table and are referred by foreign key, then they could be updated independently from the product, causing errors of the type where may become measurable in a non-sensical unit.
This is a case where "commonality/variablity" analysis helps determine the required relationships. Figure out what stays constant and what can vary. In your example, the relationship between product and unit price can vary, but the relationship between product and unit measure should be fixed. Record the price in terms of price per unit and store the unit measure with the product. Also I think it may be clearer to call the price "unit price" -- price per unit of measure that the product can be sold in.
I would design it like this:
class UnitPrice < ActiveRecord::Base
belongs_to :product
end
class Product < ActiveRecord::Base
UNITS = %w(kg lbs liters gallons floz oz meters inches feet count) # add here as needed
has_one :unit_price
validates :unit, :inclusion => {:in => UNITS}
def price_quote(amount)
unit_price * amount
end
end
This way you could conceivably also support more than one unit price on a product, e.g. for volume discounts, sales offers, etc.
By the way, if the item is measured simply in count, rather than weight, volume, etc., then the unit is "count", e.g. 5 dinner plates, and you have a unit price for 1 dinner plate.
On another note, if you're storing price data, use Integers or Decimal types. Don't use floats. See this answer.