Forum: Ruby on Rails Please Help!

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Emanuele Mek Tozzato (Guest)
on 2007-06-15 00:22
(Received via mailing list)
Ciao PPL!

in our project we use this global method:

# application.rb
  def set_user_authenticated(user)
    self.app_user = user

I need to call it from inside a method that belongs to User model..

# user.rb
  def track_successful_payment(promo, transaction_id)

I've tried to create a new method:

  def track_successful_payment(promo, transaction_id)

# in user.rb
  def set_authenticated

but I'm not on the right way...

please help this is more than critical right now! :D
MichaelLatta (Guest)
on 2007-06-15 00:58
(Received via mailing list)
You are finding it difficult because it is not a recommended practice
for the model to know anything about the session.  The controller that
invokes your model method to track payments should set the
authentication to the user that is involved in the payment if that is
what you want done.  Separating these issues of data management and
session management is a key aspect of Rails.

This topic is locked and can not be replied to.