Fix bug PG::AmbiguousColumn on PreferenceListDossier
This commit is contained in:
parent
2a2ccec373
commit
dd75a58a6c
2 changed files with 3 additions and 1 deletions
|
@ -8,7 +8,7 @@ class PreferenceListDossier < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def table_with_s_attr
|
||||
return self.attr if table.nil? || table.empty?
|
||||
return 'dossiers.'+self.attr if table.nil? || table.empty?
|
||||
table + 's' + '.' + attr
|
||||
end
|
||||
|
||||
|
|
|
@ -105,7 +105,9 @@ class DossiersListGestionnaireService
|
|||
filter = "%"+filter+"%" unless filter.include? '%'
|
||||
|
||||
acc += (acc.to_s.empty? ? ''.to_s : " AND ") +
|
||||
"CAST(" +
|
||||
preference.table_with_s_attr +
|
||||
" as TEXT)" +
|
||||
" LIKE " +
|
||||
"'" +
|
||||
filter +
|
||||
|
|
Loading…
Reference in a new issue