{"issue":{"state":"open","created_at":"2011-11-22T06:03:19Z","updated_at":"2011-11-22T10:31:18Z","user":{"gravatar_id":"548f5c4fc1de3276f83f66384d3433ad","id":48778,"url":"https://api.github.com/users/pvencill","login":"pvencill","avatar_url":"https://secure.gravatar.com/avatar/548f5c4fc1de3276f83f66384d3433ad?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":1,"body":"I am trying to follow your example.  I have a set of objects arranged something like folders of forms.\r\n\r\nSo, each folder belongs to a user, and has_many forms, each form has_many answers.\r\n\r\nWhen I try and clone using deep_cloneable, I don't get the parents set right.  So for example:\r\n\r\nnew_folder = folder.clone :include=>[:user, {:forms => :answers}]\r\n\r\nIt populates the in-memory objects with all the cloned values correctly, *except* I get validation errors that the form's folder_id is nil but is required, and the answers' form_id is nil and is required.  I recognize that I could remove those validation checks if I wanted, but it seems like an odd thing to fail on, given that I have :autosave=>true on the has_many relationships.\r\n\r\nConversely the user_id is likewise required ,but it does *not* throw a validation error, and that belongs_to attribute does not have autosave turned on.\r\n\r\nAny ideas how to resolve this?","assignee":null,"id":2314837,"number":11,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[],"title":"Rails 3.0.9 not picking up has_many association","html_url":"https://github.com/moiristo/deep_cloneable/issues/11","closed_at":null,"url":"https://api.github.com/repos/moiristo/deep_cloneable/issues/11","milestone":null},"action":"created","comment":{"created_at":"2011-11-22T10:31:18Z","updated_at":"2011-11-22T10:31:18Z","user":{"gravatar_id":"67364c084713f82d505a52316d90dabd","id":19221,"url":"https://api.github.com/users/moiristo","login":"moiristo","avatar_url":"https://secure.gravatar.com/avatar/67364c084713f82d505a52316d90dabd?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"I usually check for presence of the associated object instead of the ID, so instead of 'validates :form_id, :presence => true' I'd use 'validates :form, :presence => true'. ","id":2832766,"url":"https://api.github.com/repos/moiristo/deep_cloneable/issues/comments/2832766"}}