Hi. I am new to RoR. I am beginning my first app. It's a simple
application for roofing contractors.
I want to start slow. I can "migrate" as I go, correct?? (smile)
So Far I have Three Models:
CUSTOMERS , JOBS, ESTIMATES
there will be more someday.
So far, the model should adhere to these simple rules:
-----------------------------------------------------------------------------------------------------
1. You can enter a customer without it being a JOB or ESTIMATE.
2. You can CONVERT a customer to a JOB.
3. You can CONVERT an ESTIMATE to a JOB.
4. A JOB MUST have a customer.
5. An ESTIMATE MUST have a customer.
6. CUSTOMER can have MANY jobs.
7. CUSTOMER can have MANY ESTIMATES.
8. Once converted from ESTIMATE to JOB , removed from ESTIMATE.
This sounds reasonable - as do your models. As things stand your rules
abut jobs having to have an associated customer will not be enforced.
I usually use a foreign key constraint for that sort of thing.
One suggestion though: don't delete estimates when they turn into a job.
I don't know much about the sector in which you're doing business, but
an audit trail is often valuable. If you do that then you probably
want job to belong_to estimate( in addition to what you've already got).