@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/2417548...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to