Hi there,
I'm still new to Rails, but I'm very excited about it! I love Devise and now I found a gem 'public_activity' which perfectly fits my needs. PublicActivity works great, but I want to track the users login and logout actions. PublicActivity works on the model. After create, update, destroy, etc. there will be generated a new record in the activities database.
I added public_activity to my user model and it works fine. If the user signs in into my app he gets updadted by devise (mainly setting last_login, ip etc.) and a public_activity update record will be done. But with public_activity it is possible to define custom actions by keys. Therefore I want to create a custom activity key on every sign in and sign out. To do this, I have to put the following line for the save call of the user which currently signed in.
"@user.activity :key => 'activity.users.login'"
If that is possible I can create a custom message "User xy signed in". Currently there will be displayed "User xy was changed". I have absolulety no idea where to put this line. I saw the SessionsController#new method, but didn't found any save call.
Is it possible to overwrite the login action to put this line before the user gets updated? Are there any callbacks I can use?
Thanks for every tip!
Martin