Access to @session object from model


I’m using login_generator as authentication mechanism.
I’m trying to make some logging system with sql as backend, and
I need have access to @session object within models.
Example code which won’t work (It dosn’t make anything) :
before_create { | record | a = @session[:user].id }
I’m getting error like this:

You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.[]

This line is line above :frowning:

Any suggestions or there is some sql base logging method for
rails ??


For Rails questions you’ll want to ask the Rails list because they
have armies of Rails users there.

Eric H. - removed_email_address@domain.invalid -
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

This implementation is HODEL-HASH-9600 compliant