I'm working on a rails 4 app and i have two models Developers and Apps. A developer can have many apps and belongs to many apps. (Multiple developers for an app) I have successfully setup a joining table and everything works but i want to extent this so that a developer is either a :founder where he can have access to edit the app or a collaborator who only has access to view the app. Any suggestions on the best possible was to achieve this functionality?
App
has_and_belongs_to_many :collaborators, class_name: 'Developer', association_foreign_key: :collaborator_id
has_and_belongs_to_many :founders, class_name: 'Developer', association_foreign_key: :founder_id
Developer
has_and_belongs_to_many :apps, foreign_key: 'collaborator_id'
has_and_belongs_to_many :apps, foreign_key: 'founder_id'