-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic events #8324
Generic events #8324
Conversation
68ada76
to
2ce0164
Compare
I'm going to validate the migration locally, but have no issues with this. I will ask to coordinate merge so I can be on hand though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, this looks fine as is but the comment above may make it cleaner. Either way it looks fine to me.
👍 |
@ewdurbin I'll let you merge whenever you're free to babysit this. |
🖖🏼 20.778 month old PR 🚢 |
* Generic events * Update migration to rename table/columns in place * Use AbstractConcreteBase * Address feedback from review * Remove commented out line * Linting
This PR introduces a generic
HasEvents
subclass for models that have related events, and migrates the existingUserEvents
andProjectEvents
models to it. It uses generic associations but maintains essentially the same underlying "table per related" structure.This ensures that events are created and associated with their sources in a consistent and generic way, and allows us to add event support to any new or existing model simply by adding the
HasEvents
mixin to the models class definition.