Forum: Ruby on Rails Callbacks with parameters

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Pedro C. (Guest)
on 2007-07-13 13:45
Hello.

I need to pass a user_id that I have in a session var to a before_save
callback. Is it possible?

Thanks
Mark Reginald J. (Guest)
on 2007-07-13 14:21
(Received via mailing list)
Pedro C. wrote:

> I need to pass a user_id that I have in a session var to a before_save
> callback. Is it possible?

Best way would be to add a user_id attr_accessor to the model,
and to set and access that.

--
We develop, watch us RoR, in numbers too big to ignore.
Pedro C. (Guest)
on 2007-07-13 14:24
Thanks... I will do just that...
This topic is locked and can not be replied to.