[openstreetmap/openstreetmap-website] Add status filter to user's note page (PR #5297)
Anton Khorev
notifications at github.com
Wed Nov 6 08:31:19 UTC 2024
@AntonKhorev commented on this pull request.
> @@ -34,6 +34,16 @@ class Note < ApplicationRecord
scope :visible, -> { where.not(:status => "hidden") }
scope :invisible, -> { where(:status => "hidden") }
+ scope :with_status, lambda { |status|
+ case status
+ when "open"
+ where(:status => "open")
+ when "closed"
+ where(:status => "closed")
+ else
+ all
+ end
+ }
Do we even need the scope? A similar scope for issues is not used by the issues controller:
https://github.com/openstreetmap/openstreetmap-website/blob/e15a92a30213d87e10e000a240a7dcab66c208b4/app/controllers/issues_controller.rb#L37
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5297#discussion_r1830581236
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5297/review/2417548565 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241106/6da5c92a/attachment.htm>
More information about the rails-dev
mailing list