I've got something like this:
Project has_many tasks
Task belongs_to project
I have simple validation in each. The problem is, if I do something
like:
p = Project.new
p.tasks.build # <-- not valid because of blank field
p.tasks.build
p.tasks.build
p.valid? -> false
All good so far. But if I look at the errors on p:
y p.errors
I see something like:
errors:
name:
- can't be blank # this is fine
tasks:
- is invalid
- is invalid
- is invalid # these, not so much
I do not have a call to "validates_associated" in my Project model, so
why is it picking up errors on the associated objects?
Thanks in advance...
-glenn
--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---