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:
@@ -950,6 +950,7 @@ class PostQueryBuilderTest < ActiveSupport::TestCase
|
||||
assert_tag_match([s], "rating:s")
|
||||
assert_tag_match([q], "rating:q")
|
||||
assert_tag_match([e], "rating:e")
|
||||
assert_tag_match([e, q], "rating:q,e")
|
||||
assert_tag_match([], "rating:s rating:q")
|
||||
|
||||
assert_tag_match(all - [s], "-rating:s")
|
||||
|
||||
Reference in New Issue
Block a user