From 483c8ba7952d81162bfc3c3adc30719eece4c097 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Wed, 22 Nov 2017 15:41:50 -0800 Subject: [PATCH] fix ambiguities in artist search --- app/models/artist.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/artist.rb b/app/models/artist.rb index db1f1464c..142dc99dc 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -497,15 +497,15 @@ class Artist < ApplicationRecord end if params[:id].present? - q = q.where("id in (?)", params[:id].split(",").map(&:to_i)) + q = q.where("artists.id in (?)", params[:id].split(",").map(&:to_i)) end if params[:creator_name].present? - q = q.where("creator_id = (select _.id from users _ where lower(_.name) = ?)", params[:creator_name].tr(" ", "_").mb_chars.downcase) + q = q.where("artists.creator_id = (select _.id from users _ where lower(_.name) = ?)", params[:creator_name].tr(" ", "_").mb_chars.downcase) end if params[:creator_id].present? - q = q.where("creator_id = ?", params[:creator_id].to_i) + q = q.where("artists.creator_id = ?", params[:creator_id].to_i) end # XXX deprecated, remove at some point.