Hello, all,
Say I own a freelance article editing company that help my clients editing their articles to a certain standard. And my employees are editors. a Article Model, an Assignment Model, and then an Editor Model. Most of the time one article is edited by one Editor ( and this arrangement is called an Assignment). Sometimes, things get rushy and we put a few editors for one article.
so I guess I will have a many Editors to many Articles relationship by using the Has_many :through => :assignments
class Editor < ActiveRecord::Base has_many :assignments has_many :articles, :through => :assignments end
class Assignment < ActiveRecord::Base belongs_to :article belongs_to :editor end
class Article < ActiveRecord::Base has_many :assignments has_many :editors, :through => :assignments end
If I want only relevant editor(s) to see an article--relevant being defined as the editor(s) is assigned to that very artcile--and also to update that artcile, as needed for editing it, where would one put such a mechanism (ApplicationController / Model / elsewhere)? And how would such a mechanism work?
Thanks@