Before save infinite loop

Hi all

Heres what I am trying to do, I have a table that has a process and it
has process_details

process
has_many process_details, foreign_key => :process_id

process_detail
belongs_to process

each process has a number that is associated with it, the step it is
1,2,3,4 . . …
Now the steps can be changed if the process changes, for example step
3 becomes step 1 . My algorithm is trying to update each record in
before_save that would need to be change to keep the ordering . (1,2
would be change to 2,3 respectively) the problem is is that I am
calling update in before save which initiates before save again.

if anyone has an ideas to stop the recursiveness of this call or
another way to keep the ordering please tell me, all help is
appreciated.

White W.

self.attributes[field_name] = value - this doesnt call the before save
method

regards
ivor

On 10/4/07, White W. [email protected] wrote:

belongs_to process
another way to keep the ordering please tell me, all help is
appreciated.

Stepping back from the tree to the forest.

Have you considered using acts_as_list?


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs