Choosing the right record for the Event #471
-
We have migrated from V1 to V2 and overall loving it. Great job @excid3 and team There is one part where I am a bit confused is for choosing the right record for the Noticed::Event Here is a simplified version of one of our notification We have Teachers having Students. Students write Stories and Teachers correct their Stories We have a StudentStory::CorrectedNotifier.with(record: ...).deliver(student) For the record I wonder if I should give the My first idea was to use the student_story as the record but then I thought maybe using the student would simplify some queries down the road? Do you have any suggesting on how to best choose the record? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yep, sounds right to me. Record should be whatever object the notification is primarily about because you'll need it for rendering. |
Beta Was this translation helpful? Give feedback.
Yep, sounds right to me. Record should be whatever object the notification is primarily about because you'll need it for rendering.