Fix #3696: API: handle boolean params consistently
* Use ApplicationRecord#attribute_matches to handle boolean attributes consistently in search methods. * Add support for searching various boolean attributes that previously weren't supported.
This commit is contained in:
@@ -98,11 +98,7 @@ class PostFlag < ApplicationRecord
|
||||
q = q.post_tags_match(params[:post_tags_match])
|
||||
end
|
||||
|
||||
if params[:is_resolved] == "true"
|
||||
q = q.resolved
|
||||
elsif params[:is_resolved] == "false"
|
||||
q = q.unresolved
|
||||
end
|
||||
q = q.attribute_matches(:is_resolved, params[:is_resolved])
|
||||
|
||||
case params[:category]
|
||||
when "normal"
|
||||
|
||||
Reference in New Issue
Block a user