[openstreetmap/openstreetmap-website] Create a ChangesetSubscription model (Issue #5540)
Andy Allan
notifications at github.com
Thu Jan 23 11:38:54 UTC 2025
We have various subscription models, such as NoteSubscription and DiaryEntrySubscription. We also have a table "changeset_subscribers" which does the same thing (pairs of user_id/object_id), but we don't have a corresponding model. Instead we declare it as a join association in Changesets, and use custom methods on the changeset model (e.g. `changeset.subscribe(user)`) to indirectly add and remove the rows in that table.
I think it would be worth refactoring this code, to make subscriptions behave the same way across all three models. So we should
* Create a ChangesetSubscription model, although it will need `self.table_name = "changeset_subscribers"`
* Refactor `changeset_subscriptions_controller` to use the ChangesetSubscription model, likely through changeset.subscriptions.new
* Remove the subscribe/unsubscribe methods from the Changeset model, since these aren't acting on the Changeset model itself.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5540
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/5540 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250123/206a1e89/attachment.htm>
More information about the rails-dev
mailing list