accounts
account_jobs (account_id, job_id)
jobs
job_submissions (job_id, submission_id)
submissions
My Account model looks like this:
- has_many :account_jobs
- has_many :jobs, :through => :account_jobs
I want to have all the job_submissions and submissions that belong to
this account, WITH the ability to further search through them (example:
Account.find(1).submissions.find(1) ).
accounts
account_jobs (account_id, job_id)
jobs
job_submissions (job_id, submission_id)
submissions
My Account model looks like this:
- has_many :account_jobs
- has_many :jobs, :through => :account_jobs
I want to have all the job_submissions and submissions that belong to
this account, WITH the ability to further search through them
(example:
Account.find(1).submissions.find(1) ).
don't you just want to add has_many job_submissions & has_many
submissions :through => job_submissions ?
well it might be a good idea to add one, otherwise you will haver to
do a JOIN over 5 tables ... with or without a rails-built-in way of
doing that join, it's not a very good thing, from a performance
perspective.
If those submissions always (in terms of logic) belong to to current
user/account that is creating them, it's a rather small change to add
those account_id columns to the sub_submissions table, add the
belongs_to and add the account in the create action of the
job_submission.