> current_user is what you're looking for.  The difference between
> current_user (used in the view) and acting_user (used in the models)  
> is
> a common source of confusion.
>
> Why are they different?  You'd have to ask Tom, but I can imagine
> scenarios where they might actually be different values.

Consider me asked : )

Although it is a common source of confusion, it's actually fairly  
important to understand the difference between the two concepts, or  
you're at risk of messing up your nice MVC separation. current_user  
only makes sense in conjunction with the idea of a "current session",  
which only exists in the view and controller layers. That's why in  
'normal' Rails apps you just can't get at that information from the  
model.

But it struck me that "this model-level action is happening on behalf  
some specific user" is such a fundamental aspect of the kind of apps  
we right, that it was a good idea to support this in the model layer.  
As Bryan says, it's not _necessarily_ the current_user from the  
session. Rather, it's the user who is performing this action - the  
acting_user.

Sometimes a common source of confusion is a good thing, because what's  
actually going on is a common misconception, and the confusion is an  
opportunity to straighten things out.

Tom


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to