How do I update an objects main_document?

36 views
Skip to first unread message

Steven B

unread,
Dec 17, 2013, 5:14:56 PM12/17/13
to social...@googlegroups.com
I've set some documents to the property_objects of an activity_object like so:

@activity_object.object.property_objects << @document.activity_object

This allows me to do @activity_object.object.documents and I have a @activity_object.object.main_document.

How do I set the main_document to a different property_object? I've tried:

@activity_object.object.main_document = @document

where @document is some other property_object document for @activity_object. This gives me:

ActiveRecord::HasManyThroughNestedAssociationsAreReadonly (Cannot modify association 'ActivityObject#main_document' because it goes through more than one other association.):
Reply all
Reply to author
Forward
0 new messages