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:
evazion
2022-05-18 12:54:43 -05:00
parent af8ef8b277
commit 141044d352
8 changed files with 21 additions and 28 deletions

View File

@@ -128,7 +128,7 @@ class PostQueryBuilder
when "child"
relation.child_matches(value)
when "rating"
relation.where(rating: value.first.downcase)
relation.rating_matches(value)
when "embedded"
relation.embedded_matches(value)
when "source"