I am working with Rails 3, and I have a model called User that authors a Syllabus. I would like to add the feature of “co-authoring” a syllabus, so the original author can invite a different user to make changes to the content.
Which options below makes more sense? (If there’s something better, please let me know)
-
make the author attribute an array attribute, so that Syllabus.author would be an array containing all of its authors
-
create additional attributes to Syllabus, such as coauthor1, coauthor2
If the first one makes more sense, would you be able to specifically describe how would I make it an array attribute, and insert additional authors later?
One reason I was considering the second option was because that would allow a distinction between the original author and the other co-authors, enabling perhaps only the original author to delete the Syllabus, while other co-authors have limited authority?
You can also make linking table like this: