How to get the current_user in a model observer?
Given the following models: Room (id, title) RoomMembers (id, room_id) RoomFeed, also an observer When a Room title is updated, I want to create a RoomFeed item, showing who the user is who made the update. @room.update_attributes(:title => "This is my new title") Problem is in my observer for RoomFeed: def after_update(record) # record is the Room object end The is no way for me to get the user.id of the person who just made the update. How do I go about doing that? is there a better way to do the update so I get the current_user? I think what you are looking for is, room.updated_by inside