Displaying 1 result from an estimated 1 matches for "risk_matrix".
2006 Dec 05
4
has_many with :uniq not working for me
Hi all,
I have a relationship (no really!)
class RiskMatrix < ActiveRecord::Base
has_many :severities, :order => :position, :uniq => true
end
class RiskFactor < ActiveRecord::Base
belongs_to :risk_matrix
validates_presence_of :descriptor, :example
validates_uniqueness_of :descriptor, :example, :scope=> :risk_matrix_id
end
class Severity < RiskFactor
acts_as_list :scope => :risk_matrix
end
I don''t want any duplicates for a given risk matrix of a risk factor so I
wrote...