[Pharo] Personal fitness tracker web app.
Update Descriptor system.
Changed files
src/MyFitnessTracker-Glorp-Tests/MFTDescriptorSystemTest.class.st
@@ -126,14 +126,15 @@
126
126
{ #category : 'running' }
127
127
MFTDescriptorSystemTest >> sampleStraightSetGroupPrescription [
128
128
129
Removed:
^ MFTStraightSetGroupPrescription withSet: self sampleSetPrescription
129
Added:
^ MFTStraightSetGroupPrescription withSets:
130
Added:
{ self sampleSetPrescription }
130
131
]
131
132
132
133
{ #category : 'running' }
133
134
MFTDescriptorSystemTest >> sampleTrainee [
134
135
135
136
^ MFTTrainee new
136
Removed:
routine: self sampleRoutine;
137
Added:
currentRoutine: self sampleRoutine;
137
138
logBook: self sampleWorkoutLogBook;
138
139
yourself
139
140
]
@@ -331,38 +332,6 @@
331
332
self assert: loaded exercise englishName equals: 'test bench press'.
332
333
self assert: loaded repScheme minReps equals: 6.
333
334
self assert: loaded repScheme maxReps equals: 10
334
Removed:
]
335
Removed:
336
Removed:
{ #category : 'running' }
337
Removed:
MFTDescriptorSystemTest >> testTraineeReloadsRoutineAndLogBook [
338
Removed:
339
Removed:
| trainee loaded |
340
Removed:
trainee := self sampleTrainee.
341
Removed:
self persist: trainee.
342
Removed:
343
Removed:
loaded := self
344
Removed:
readOneOf: MFTTrainee
345
Removed:
where: [ :each | each id = trainee id ].
346
Removed:
347
Removed:
self assert: loaded routine title equals: 'Test Heavy Duty routine'.
348
Removed:
self assert: loaded logBook workoutLogs size equals: 1
349
Removed:
]
350
Removed:
351
Removed:
{ #category : 'running' }
352
Removed:
MFTDescriptorSystemTest >> testWorkoutLogBookReloadsWorkoutLogs [
353
Removed:
354
Removed:
| logBook loaded |
355
Removed:
logBook := self sampleWorkoutLogBook.
356
Removed:
self persist: logBook.
357
Removed:
358
Removed:
loaded := self
359
Removed:
readOneOf: MFTWorkoutLogBook
360
Removed:
where: [ :each | each id = logBook id ].
361
Removed:
362
Removed:
self assert: loaded workoutLogs size equals: 1.
363
Removed:
self
364
Removed:
assert: loaded workoutLogs first prescription title
365
Removed:
equals: 'Test Heavy Duty workout'
366
335
]
367
336
368
337
{ #category : 'running' }
src/MyFitnessTracker-Glorp/MFTDescriptorSystem.class.st
@@ -208,7 +208,7 @@
208
208
MFTDescriptorSystem >> classModelForMFTTrainee: aClassModel [
209
209
210
210
(aClassModel newAttributeNamed: #id) useDirectAccess: true.
211
Removed:
aClassModel newAttributeNamed: #routine type: MFTRoutine.
211
Added:
aClassModel newAttributeNamed: #currentRoutine type: MFTRoutine.
212
212
aClassModel newAttributeNamed: #logBook type: MFTWorkoutLogBook
213
213
]
214
214
@@ -541,7 +541,7 @@
541
541
aDescriptor table: table.
542
542
self mapIdOf: aDescriptor to: table.
543
543
(aDescriptor newMapping: OneToOneMapping)
544
Removed:
attributeName: #routine;
544
Added:
attributeName: #currentRoutine;
545
545
referenceClass: MFTRoutine;
546
546
join: (Join
547
547
from: (table fieldNamed: 'routine_id')