collectiveidea/awesome_nested_set — pull request #207 by tiagoefmoraes (2013-09-12 23:01:27+00:00)
Title: Modify associate_parents to add child objects to the parent#children collection

Hello,
associate_parents currently calls `association.set_inverse_instance(parent)` but on the current version of activerecord doesn't support setting inverse has_many associations:
```ruby
# NOTE - for now, we're only supporting inverse setting from belongs_to back onto
# has_one associations.
def invertible_for?(record)
inverse = inverse_reflection_for(record)
inverse && inverse.macro == :has_one
end
```
[belongs_to_association.rb line 72](https://github.com/rails/rails/blob/dfd7454683c0222bdb741753b76e8d68f5e73aef/activerecord/lib/active_record/associations/belongs_to_association.rb#L72)

I implemented this fix to not depend on activerecord's association#set_inverse_instance implementation.