I am preparing a rail app that allows athletes to create and manage a spreadsheet for a skeleton game. I am unable to wrap my brain around the right associations in my model. Even what I have so far is athlete in runs , which is composed of many divisions each separate split one A specific time should be connected to the Eye at Bocchel / Skeletal Track . A collection of collections on a particular date on a particular date, and on a particular circuit , is organized in the timesheets , creating athlete tilesheets, adding runs in the tilesheet and dividing it , And then there is the ability to view and graph runs on TimesShield. Wow. Here are some codes:
class athlete & lt; ActiveRecord :: Base has has_many: runs has_many: timesheets ,: through = & gt; : And Class Run Runs & lt; ActiveRecord :: Base is_to: athlete related_to: timesheets is_main: splits and class timesheets & lt; ActiveRecord :: Base has has_many: runs has_many: athletes ,: through: = & gt; : Runs is_to: track is_to: circuit over class split & lt; ActiveRecord :: Base is_to: run is_to: Eye End Class Track & lt; ActiveRecord :: Base has has_many: timesheets has has_many: eyes end class circuit & lt; ActiveRecord :: Base is has_many: timesheets end class eye & lt; ActiveRecord :: Base has has_many: runs has_many: splits belong_to: track end It seems like I made some unnecessary associations here in both my eyes and tracks of time in my biggest frustration TimesShot Scene Table Combines the division with. Table headers are the eyes of time, on that day (the eye of each time does not change every day), whereas the table cells are the actual division time (sometimes, one time eye one at a time for an athlete Misses special division).
Do you see a place where these organizations can be improved?
I recommend starting with only the minimum association to cover your schema. Then add others later to help with ideas.
The example looks like
The track has several circuits
There are many eyes in the circuit
Then the first model lets you have eyes There is no need to be related to. - It can be added later, if necessary.
Similarly, there are many circuits in a tileheet. There is no need to initialize the track in TimesShield (initially) You can find a track / tileysheet relationship through the circuit.
Remember that essentially reporting output data against the data. So you can easily get a desired view, which requires many database calls or other massages of data, so that they can produce the desired data for the view / report.
Example Your Report You Think You Must Know Before You Apply The Applied Time Again, for every eye, retrieve the split.
Similarly, for the input field, you can see the information from the user. For example, you can create groups with each circuit as separate items for the circuit.
On the other hand, if it was not complicated then nobody could do this ....
Comments
Post a Comment