validates_uniqueness_of results in " undefined method `text?' for nil:NilClass "
By: Johnathon Wright on: July 07, 2010
I had the following model:
--- ruby class Visit < ActiveRecord::Base
belongsto :visittype belongs_to :patient
validatespresenceof :visittype validatespresenceof :patient validatespresence_of :date
validatesuniquenessof :visit_type
end
I changed :visittype to :visittype_id and it went away.