Hey, danke für den Tipp. leider brauchte ich aber gerade den eingeloggten
user also mit acts_as_authenticated den @current_user ...
Wie "immer" bietet 'google' die Lösung (wenn man weiss wonach man suchen
muss .... ;)

das plugin: acts_as_audited.
http://opensoul.org/2006/07/21/acts_as_audited

ich habs mir noch nicht genau angeschaut aber Im plugin wird das Problem
wohl über sweeper gelöst.

greets kalle


On 11/4/07, Alexander Lang <[EMAIL PROTECTED]> wrote:
>
> gar nicht, denn dein observer haengt am model und das hat keinen
> zugriff auf @current_user, was vermutlich der gerade eingeloggte user
> in deinem controller ist. stattdessen solltest du die user_id ueber
> dein model bekommen, also bill.user_id oder sowas. zum thema rails
> observer hab ich zufaellig gerade was zusammengeschrieben:
> http://upstream-berlin.com/blog/2007/10/27/using-and-testing-activerecordrails-observers/
>
> cheers,
> alex
> On 03/11/2007, at 15:34, kalle saas wrote:
>
> > Hey,
> > wie kann man in Observer auf instance Variablen zugrefen?
> > Ich baue gerade das "latest activity" feature in meine webapp ein
> > und habe das versucht:
> >
> >   def after_destroy(bill)
> >     activity = Activity.new
> >     activity.category_id = 1
> >     activity.user_id = @current_user.id
> >     activity.save(false)
> >   end
> >
> >
> > weis jemand wie das gehen könnte?
> >
> > greets kalle
> > _______________________________________________
> > rubyonrails-ug mailing list
> > [email protected]
> > http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug
>
> http://upstream-berlin.com/blog <- blog
> http://autoki.com/profile/alex <- autos 2.0
> http://kommt-mit.de <- reisen 2.0
>
> _______________________________________________
> rubyonrails-ug mailing list
> [email protected]
> http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug
>



-- 
Details:
Kalle Saas
Grellstraße 3
10409 Berlin
tel: 0176 231 60 989
web: www.crosstheocean.de
_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug

Antwort per Email an