-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Setup
class Post include Mongoid::Document has_and_belongs_to_many :tags end class Tag include Mongoid::Document has_and_belongs_to_many :posts end tag = Tag.create post = Post.create(tags: [tag]) post.tags = [Tag.last]
Expected Behavior
post.reload.tag_ids #=> [tag.id] tags.reload.post_ids #=> [post.id]
Actual Behavior
post.reload.tag_ids #=> [tag.id] tag.reload.post_ids #=> []
Commit has a failing test in the many_to_many_spec.rb, but we aren't sure how to fix with out breaking other functionality.
- duplicates
-
MONGOID-4273 Self-referencing has_and_belongs_to_many not updated properly
- Closed