문제

How can we have two methods for after_add callback on mongoid relations. Both the methods need to do different things?

has_and_belongs_to_many :posts, after_add: method1, after_add: method2

도움이 되었습니까?

해결책

try this

 has_and_belongs_to_many :posts, after_add: [:method1, :method2]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top