For my project management application, I am currently using Single Table Inheritance so that:
Lead < Requirement
Project < Requirement
By which I mean to say that Lead is a Requirement and Project is a Requirement. It was okay, while I had these two only. Then I had another similar thing (Tender), so I created
Tender < Requirement
Now the problem is when a Tender converts to a project there is no way for me to identify which projects were Tenders and which were Leads. So I can't say for example:
Out of 100 leads I get 20 projects and out of 100 Tenders I get 5 projects.
For now as a workaround I think I can use boolean field to say if this was a tender. But that defeats the purpose of having STI. Is there another way to do this using STI itself. Or are booleans [or some sort of category/project_type field] the only way to accomplish this.
Can I use state_machine for this?
I have been trying to get this right for some time now. Any help would be great.