To follow up, I implemented my rough idea from yesterday. The goal is
to get the active user information into ActiveRecord to perform
validation and logging.
Here''s how it works:
I use a before_filter in ApplicationController that assigns the
user to a class variable in an observer
I use the observer to assign the active user to the ActiveRecord
in before_validation.
Active user is then available for validations and callbacks.
If I understand correctly, even though I am essentially using a global
- only one request will ever be handled in one process at one time - so
this will be safe. My question is can an observer ever be working with
more than one request at once?
I''d also like to hear any other ideas for passing the active user to
ActiveRecord.
--
Jack Christensen
jackc-/SOt/BrQZzOj3I+7jmQ39gC/G2K4zDHf@public.gmane.org
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails