[#2750] No need to validate table and column
Because they are pre-validated by rails on the model
This commit is contained in:
parent
58c0ec1bbd
commit
30ef6e6d95
1 changed files with 0 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue