ActiveRecord as a delayed task. If the task ends with an error, I'd
*like* to set myActiveRecord.errors[:base] << 'error message'. The only
twist is that errors will be caught in the delayed task's thread.
My early experiments suggest that this won't work, at least not in the
obvious way: when I look at myActiveRecord.errors in the primary thread,
it appears empty, even though it was set in the delayed task's thread.
Is there a way to get the error to turn up in the primary thread?
(As a guess: I'm guessing no, because the in-memory copy of
myActiveRecord in the delayed task's thread is not the same in-memory
copy of myActiveRecord in the primary thread. The only way to get the
error message to turn up in both threads is to make it a field in the
my_active_records tables. Yes?)
Posted via http://www.ruby-forum.com/.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to email@example.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.