ruby on rails - Is it possible to associate records N-N multiple times via different name? -


i'm using mongoid.

if task has list of writers, task has_many :writers , writer has_many :tasks.

what if want task has_many :editors well, have writer model act editor?

in other words, there way relate same model twice?

something this, please check correctness , adjust if needed

has_many :editors, class_name: "writer", inverse_of: :writter 

so should use inverse_of , class_name


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -