문제

I'm trying to implement a nested set that belongs to another model using the Ancestry gem.

Using the old Posts/Comments example, I'm trying to do something like this:

Post
has_many comments

Comment
belongs_to post
has_ancestry

So if I have a Comment which belongs to a Post with ID of 1, I want any children of that Comment to inherit the Post ID.

Is there a nice Rails-Way to do this?

도움이 되었습니까?

해결책

I think you should watch this

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top