Displaying 1 result from an estimated 1 matches for "taskscontrollertest".
Did you mean:
taskcontrollertest
2005 Feb 09
1
[DEFECT] ''validates_inclusion_of'' not working as expected (couldn''t post to Trac as it gave me an error)
...tiveRecord::Base
belongs_to :project
validates_inclusion_of :project, :in Project.find_all
end
---
You would expect the validation to work properly (Project.find_all
returns an enumerable), but Ruby complains of a syntax error when
performing the validation callback:
---
1) Error:
test_create(TasksControllerTest):
SyntaxError: compile error
/usr/local/ruby/lib/ruby/gems/1.8/gems/activerecord-1.6.0/lib/active_record/validations.rb:378:
syntax error
errors.add("project", "is not included in the list") unless
([#<Project:0xb7d47a88 @attributes={"name"=>"First Project&q...