[#3477] Make sanitized_column dryer
This commit is contained in:
parent
1f34d971d1
commit
00ca2e0cbb
1 changed files with 3 additions and 4 deletions
|
@ -270,10 +270,9 @@ class ProcedurePresentation < ApplicationRecord
|
|||
|
||||
def sanitized_column(field)
|
||||
table = field['table']
|
||||
table = ActiveRecord::Base.connection.quote_column_name((table == 'self' ? 'dossier' : table).pluralize)
|
||||
column = ActiveRecord::Base.connection.quote_column_name(field['column'])
|
||||
|
||||
table + '.' + column
|
||||
[(table == 'self' ? 'dossier' : table).pluralize, field['column']]
|
||||
.map { |name| ActiveRecord::Base.connection.quote_column_name(name) }
|
||||
.join('.')
|
||||
end
|
||||
|
||||
def dossier_field_service
|
||||
|
|
Loading…
Reference in a new issue