Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@adkron
Created January 21, 2009 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adkron/50196 to your computer and use it in GitHub Desktop.
Save adkron/50196 to your computer and use it in GitHub Desktop.
def cascade_taskrefnos
child_tasks = Task.find_all_by_parentid(self.id)
child_tasks.each do |child_task|
child_task.update_attributes! :taskrefno => "#{taskrefno}.#{child_task.childseq}"
child_task.cascade_taskrefnos
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment