search for: risk_matrix_id

Displaying 1 result from an estimated 1 matches for "risk_matrix_id".

2006 Dec 05
4
has_many with :uniq not working for me
...y!) 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 a couple of tests. Both of them fail but I''m not sure why. def test_no severity should be duplicated for a risk_mat...