I just tried this code and was still able to create records with
different levels for the same part/product combination.

class RepairClass < ActiveRecord::Base
  belongs_to :level
  belongs_to :product
  belongs_to :part

  validates_presence_of :level_id, :product_id, :part_id
  validates_uniqueness_of :level_id, :scope =>
[ :product_id, :part_id ]
end

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to