[openstreetmap/openstreetmap-website] Add UserMute to control private message visibility (PR #4284)

Gregory Igelmund notifications at github.com
Thu Oct 26 19:35:31 UTC 2023


@grekko commented on this pull request.



> @@ -47,13 +47,14 @@ def initialize(user)
         can [:show], :dashboard
         can [:new, :create, :edit, :update, :comment, :subscribe, :unsubscribe], DiaryEntry
         can [:make_friend, :remove_friend], Friendship
-        can [:new, :create, :reply, :show, :inbox, :outbox, :mark, :destroy], Message
+        can [:new, :create, :reply, :show, :inbox, :outbox, :muted, :mark, :unmute, :destroy], Message

Thanks for bringing this up. I read the article and the described patterns and ideas sounds reasonable at first glance but I have many open questions on how I'd implement specific current non-CRUD operations in a CRUD-style.

Splitting up the `Messages#inbox`, `Messages#outbox` and `Messages#muted` actions into separate controllers, e.g. the `InboxController#index` you already mentioned seems straight forward to me.

Although I'd probably namespace those controllers e.g. like to `Messages::InboxController#index` just to make it very clear that this is about a Message Inbox and not any other Inbox.

Also I would say that `Messages#reply` could be `Messages::Replies#create` instead – in the spirit of keeping things CRUD-oriented – although I could be reading this as "This controller action creates a `Message::Reply`-record, although it actually creates just another `Message`-record 🤔 

---

The ideas of keeping things more uniform and simple resonate with me, but I'd need more time to fiddle around with the ideas and how to apply them without creating "just more code and files" without getting the benefit of more organised and easier to grasp code and files.

I must admit: Thats something I would not feel comfortable with experimenting in the scope of this PR :)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4284#discussion_r1373726077
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4284/review/1700513931 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231026/ba87f4b4/attachment.htm>


More information about the rails-dev mailing list