search for: administration_depart

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

2007 Jan 17
2
rake test and validates_inclusion_of
...ing that a model, which has a reference to another model, is OK. So for example, one assertion that passes when I do `ruby test/unit/department_test.rb`, but fails when I do `rake test` is: department = Department.new(:name => "super department", :parent_id => departments(:administration_department).id) assert department.save When I print out department.errors, I see that parent_id is invalid because it "is not included in the list". The validation I have on parent_id is: validates_inclusion_of :parent_id, :in => Department.find_all.collect { |e| e.id } So, maybe the depa...