jgraycar / Kamaete-API

https://kamaete-api.herokuapp.com
0 stars 1 forks source link

Figure out how to set up models #4

Open jgraycar opened 8 years ago

jgraycar commented 8 years ago

My thinking right now: a Setup has a StageDiagram. Performances have many Sets that are ordered using the acts_as_a_list gem. Sets are initialized to use the title and StageDiagram of a particular Setup. This way, they inherit those properties but can later be customized without changing the original Setup.

jgraycar commented 8 years ago

StageDiagrams will have many Instruments. There will be a separate model InstrumentType that has things like name, shape, size, etc. Every Instrument inherits the attributes of an InstrumentType, but then also has its own position, angle, label, etc. Inherit rather than belongs to so that if the InstrumentType is destroyed, the Instruments retain those attributes. This means, however, that updating an InstrumentType will not update the already created Instruments.

jgraycar commented 8 years ago

Instruments will have two Transitions: transitionIn and transitionOut. They will also have an optional member, who is the person playing that instrument during the set.

A Transition belongs to two Instruments, start and end (for a transition t with start i1 and end i2, i1.transitionOut = i2.transitionIn = t). They also belong to one member, the person responsible for moving the start instrument to the end instrument.

jgraycar commented 8 years ago

Change of plans: StageDiagrams are unnecessary. Simply have Sets and Setups both have_many Instruments. No need for the intermediary class.

Also, Set appears to be a reserved word. Instead we will use Stage Layout.

jgraycar commented 8 years ago

More changes: Setups are unnecessary as well, and will be removed. Instead, if a StageLayout has no associated Performance it will be considered a template layout. This also means that all StageLayouts must belong to a User, so that the template layouts can be found.