The models actually look like this: (notice the "has_one :page")

class Project < ActiveRecord::Base
  has_many :documents
end

class Document < ActiveRecord::Base
  has_one :page
  belongs_to :project
end

class Page < ActiveRecord::Base
  belongs_to :document
end

Interestingly, your suggestions successfully save the document with:

project.documents << document

But the following fails:

document.page << page

However, it is successful when I specify the document.id in the
attributes manually.  Could there be a bug with has_one or am I just
doing something wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to