[#2750] No need to validate table and column

Because they are pre-validated by rails on the model
This commit is contained in:
Frederic Merizen 2018-10-05 15:41:06 +02:00
parent 58c0ec1bbd
commit 30ef6e6d95

View file

@ -171,8 +171,6 @@ class ProcedurePresentation < ApplicationRecord
end
def get_value(dossier, table, column)
assert_valid_column(table, column)
case table
when 'self'
dossier.send(column)
@ -195,12 +193,6 @@ class ProcedurePresentation < ApplicationRecord
}
end
def assert_valid_column(table, column)
if !valid_column?(table, column)
raise "Invalid column #{table}.#{column}"
end
end
def valid_column?(table, column)
valid_columns_for_table(table).include?(column)
end