NUBIC/surveyor — pull request #276 by yipdw (2012-02-27 18:14:01+00:00)
Title: Eliminate the response_set_id validation in Response.

This validation makes it impossible to write code like this:

rs = ResponseSet.new
rs.responses.build(...)
...
rs.save!

because the presence validation introduces a cyclic dependency:

1. a response set saves its new responses, and
2. responses are validated before they are saved;
3. responses must have a response set ID, but
4. the response set ID does not exist until the response set is saved.

However, in the above pattern, ActiveRecord will first save the
ResponseSet, set response_set_id for each associated Response, and then
save each Response. Therefore, referential integrity can still be
enforced using appropriate NOT NULL and foreign key constaints in
databases that support such constraints.