forked from Gitlink/forgeplus
add: projects filter choosed
This commit is contained in:
parent
496867cac7
commit
2ea9fcd4d7
|
@ -57,6 +57,11 @@ class Projects::ListMyQuery < ApplicationQuery
|
|||
|
||||
sort = params[:sort_by] || "updated_on"
|
||||
sort_direction = params[:sort_direction] || "desc"
|
||||
scope.order("projects.#{sort} #{sort_direction}")
|
||||
|
||||
if params[:choosed].present? && params[:choosed].is_a?(Array)
|
||||
scope.order("FIELD(id, #{params[:choosed].reverse.join(",")}) desc")
|
||||
else
|
||||
scope.order("projects.#{sort} #{sort_direction}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue