We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd84a8f commit 7395af7Copy full SHA for 7395af7
app/models/puzzle.rb
@@ -2,4 +2,6 @@ class Puzzle < ApplicationRecord
2
enum :answer, ruby: 0, rails: 1
3
enum :state, { approved: 0, rejected: 1, pending: 2, archived: 3 }
4
has_many :answers
5
+
6
+ scope :archived, -> { Puzzle.where(state: :archived).order(sent_at: :desc) }
7
end
0 commit comments