Merge pull request #1947 from tchak/fix-procedure-controller-test
Fix test with ordering failures
This commit is contained in:
commit
d3ae4d86c7
1 changed files with 6 additions and 6 deletions
|
@ -232,15 +232,15 @@ class Admin::ProceduresController < AdminController
|
||||||
|
|
||||||
def path_list
|
def path_list
|
||||||
json_path_list = ProcedurePath
|
json_path_list = ProcedurePath
|
||||||
.joins(', procedures')
|
.joins(:procedure)
|
||||||
.where("procedures.id = procedure_paths.procedure_id")
|
.where(procedures: { archived_at: nil })
|
||||||
.where("procedures.archived_at" => nil)
|
|
||||||
.where("path LIKE ?", "%#{params[:request]}%")
|
.where("path LIKE ?", "%#{params[:request]}%")
|
||||||
|
.order(:id)
|
||||||
.pluck(:path, :administrateur_id)
|
.pluck(:path, :administrateur_id)
|
||||||
.map do |value|
|
.map do |path, administrateur_id|
|
||||||
{
|
{
|
||||||
label: value.first,
|
label: path,
|
||||||
mine: value.second == current_administrateur.id
|
mine: administrateur_id == current_administrateur.id
|
||||||
}
|
}
|
||||||
end.to_json
|
end.to_json
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue