Hi, all..
I am finally ready to work on the persistence end of my project. I am having a little bit of an issue, though..
more..
The Customer has a variable called ���orders��� which is just an OrderedCollection of Orders.
The trick is, this is an SMS bot, so the order has a StateMachine (SsStateMachine) that, after it receives an SMS.. it processes it, and moves (or doesn���t) along in state.
the problem I have is, when I save the customer, I need to save the orders first (I got an error stating this).
'An ActiveRecord can not reference any sub instances of instruction stream. Make sure you are not saving blocks. ���
This looks like it���s happening at the point where it is trying to save the StateMachine..
Here is the full error.. Thanks!:
Context(InstructionStream)>>sandstoneDeepCopyVisits:
BlockClosure(Object)>>sandstoneDeepCopyVisits:
SsState(Object)>>sandstoneDeepCopyVisits:
SsStateMachine(Object)>>sandstoneDeepCopyVisits:
Order(Object)>>sandstoneDeepCopyVisits:
Order(SDActiveRecord)>>sandstoneDeepCopy
SDFileStore>>storeObject:
[ self validate.
(isFirstSave := isNew)
ifTrue: [ self onBeforeFirstSave ].
self onBeforeSave.
isFirstSave
ifTrue: [ Store storeObject: self ]
ifFalse: [ Store updateObject: self ].
isFirstSave
ifTrue: [ self onAfterFirstSave ].
self onAfterSave.
self ] in Order(SDActiveRecord)>>save
[ self enter.
aBlock value ] in Monitor>>critical:
BlockClosure>>ensure:
Monitor>>critical:
Order(SDActiveRecord)>>critical:
Order(SDActiveRecord)>>save
UndefinedObject>>DoIt
OpalCompiler>>evaluate
RubSmalltalkEditor>>evaluate:andDo:
RubSmalltalkEditor>>highlightEvaluateAndDo:
[ textMorph textArea editor highlightEvaluateAndDo: ann action.
textMorph shoutStyler style: textMorph text ] in [ textMorph textArea
handleEdit: [ textMorph textArea editor highlightEvaluateAndDo: ann action.
textMorph shoutStyler style: textMorph text ] ] in GLMMorphicPharoScriptRenderer(GLMMorphicPharoCodeRenderer)>>actOnHighlightAndEvaluate:
RubEditingArea(RubAbstractTextArea)>>handleEdit:
[ textMorph textArea
handleEdit: [ textMorph textArea editor highlightEvaluateAndDo: ann action.
textMorph shoutStyler style: textMorph text ] ] in GLMMorphicPharoScriptRenderer(GLMMorphicPharoCodeRenderer)>>actOnHighlightAndEvaluate:
WorldState>>runStepMethodsIn:
WorldMorph>>runStepMethods
WorldState>>doOneCycleNowFor:
WorldState>>doOneCycleFor:
WorldMorph>>doOneCycle
WorldMorph class>>doOneCycle
[ [ WorldMorph doOneCycle.
Processor yield.
false ] whileFalse: [ ] ] in MorphicUIManager>>spawnNewProcess
[ self value.
Processor terminateActive ] in BlockClosure>>newProcess