A part of my ER-Model is not correct:
The many-to-many association between Projects and Users is simply wrong. Imagine a simple case of an deletion of a relation between an User and a Project - for example the user/employee stopped working on that particular project - causes the project also to disappear from Timereports in the past.
And this is fundamentally wrong, because he surely did work on that project!
And so the connection should be between Projects and Timereports!!! Like this:
I’m pretty sure this has to be modelled this way.
Now if the user stops working on a particular project, it’s no problem to do that deletion.
Project has_many :timereports, :through => :projects_timereports
######
Timereport has_many :projects, :through => :projects_timereports
######
ProjectsTimereports has_many :timereportentries
Ok, now I’ll have to re-code that and I hope it won’t me drive nuts to do this, because I really could have avoided it!
Recent Comments