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.
7fe16d11ca75c2de9d29bcc08a85ab9c?d=identicon&s=25 Pedro Cardoso (jotape)
on 2007-07-13 11: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
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2007-07-13 12:21
(Received via mailing list)
Pedro Cardoso 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.
7fe16d11ca75c2de9d29bcc08a85ab9c?d=identicon&s=25 Pedro Cardoso (jotape)
on 2007-07-13 12:24
Thanks... I will do just that...
This topic is locked and can not be replied to.