|
|
# Events
|
|
|
Events in Project Forum are used to keep a track record of who did what (log) and as a way to create [Notifications](Notifications) (a notification requires an event).
|
|
|
|
|
|
An event consists of a `user` performing an `action` on a `resource`, with optionally message_parameters associated with it. In addition, additional resources can be `associate`d with an event.
|
|
|
|
|
|
## Actions
|
|
|
Any string (symbol) can be used to specify the action. The resource and the action together should provide enough information to determine what the event represents. (This is currently not consistently done in the codebase, see #230).
|
|
|
|
|
|
Often actions correspond to controller actions (i.e. create/update/destroy).
|
|
|
|
|
|
## Using events
|
|
|
The concern `Notifyable` can be included to get access to the `log_event` and `log_event_with_user` methods. The `log_event` method is intended to be used from controllers, while the `log_event_with_user` can be used from any class.
|
|
|
|
... | ... | |