Given the following models:
Room (id, title)
RoomMembers (id, room_id)
RoomFeed, also an observer
When the room name is updated, I want to create a RoomFeed element, showing who the user is, who made the update.
@room.update_attributes(:title => "This is my new title")
The problem is in my observer for RoomFeed:
def after_update(record)
end
I cannot get the user.id of the person who just made the update. How should I do it? is there a better way to do an update to get current_user?
source
share