Fix SQL ambiguous name error

This commit is contained in:
Paul Chavard 2018-09-13 18:59:51 +02:00
parent b042efdcba
commit 18922122b4
2 changed files with 2 additions and 2 deletions

View file

@ -194,7 +194,7 @@ class Admin::ProceduresController < AdminController
def path_list
json_path_list = ProcedurePath
.find_with_path(params[:request])
.pluck(:path, :administrateur_id)
.pluck('procedure_paths.path', :administrateur_id)
.map do |path, administrateur_id|
{
label: path,

View file

@ -19,7 +19,7 @@ class ProcedurePath < ApplicationRecord
def self.find_with_path(path)
joins(:procedure)
.where.not(procedures: { aasm_state: :archivee })
.where("path LIKE ?", "%#{path}%")
.where("procedure_paths.path LIKE ?", "%#{path}%")
.order(:id)
end