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..

I have very simple set of models:

Customers
Orders
LineItems

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).

When I try to save the order, I get the following error:

 '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

----
peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.Village-Buzz.com
http://www.ThoseOptimizeGuys.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101