Hi, I have a backgroundrb task that performs a long running task initiated through a website. The website also uses authorization to log users on, and to record/audit who changes which record. What is the easiest way for my background tasks to pick up that information from the session of the logged in user ... or is this something I will need to pass into the do_work method? Thanks Joerg -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Joerg Diekmann wrote:> I have a backgroundrb task that performs a long running task initiated > through a website. The website also uses authorization to log users on, > and to record/audit who changes which record. > > What is the easiest way for my background tasks to pick up that > information from the session of the logged in user ... or is this > something I will need to pass into the do_work method?Pass the ID of the user into the worker''s construction parameters, and let the background task pick everything else up from the database. Your question suggests you might be abusing the session[] hash. Only use it for data that belong only to one series of pages in one web browser. Don''t use it to avoid sticking important information into the database. -- Phlip http://flea.sourceforge.net/PiglegToo_1.html --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---