How to get the current_user in a model observer?

前端 未结 5 2046
有刺的猬
有刺的猬 2021-01-13 05:35

Given the following models:

Room (id, title)
RoomMembers (id, room_id)
RoomFeed, also an observer

When a Room title is updated, I want to c

5条回答
  •  日久生厌
    2021-01-13 05:59

    I guess this is a better approach

    http://rails-bestpractices.com/posts/47-fetch-current-user-in-models

提交回复
热议问题