Rails 2.1.0 (Cannot upgrade for now due to several constraints) I am trying to achieve this. Any hints?
- A project has many users through join model
- A user has many projects through join model
- Admin class inherits User class. It also has some Admin specific stuff.
- Admin like inheritance for Supervisor and Operator
- Project has one Admin, One supervisor and many operators.
Now I want to 1. submit data for project, admin, supervisor and operator in a single project form 2. validate all and show errors on the project form.
Project has_many :projects_users ; has_many :users, :through => :projects_users
User has_many :projects_users ; has_many :projects, :through => :projects_users
ProjectsUser = :id integer, :user_id :integer, :project_id :integer
ProjectUser belongs_to :project, belongs_to :user
Admin < User # User has 'type:string' column for STI
Supervisor < User
Operator < User
Is the approach correct? Any and all suggestions are welcome.