posts: refactor hardcoded ratings.
Refactor ratings to not be hardcoded in various places. Make it so all ratings are defined in Post::RATINGS. Also make it so that you can search multiple ratings at once with `rating:q,e`.
This commit is contained in:
@@ -151,16 +151,7 @@ class PostVersion < ApplicationRecord
|
||||
end
|
||||
|
||||
def pretty_rating
|
||||
case rating
|
||||
when "q"
|
||||
"Questionable"
|
||||
|
||||
when "e"
|
||||
"Explicit"
|
||||
|
||||
when "s"
|
||||
"Safe"
|
||||
end
|
||||
Post::RATINGS.fetch(rating)
|
||||
end
|
||||
|
||||
def changes
|
||||
|
||||
Reference in New Issue
Block a user