[#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
|
end
|
||||||
|
|
||||||
def get_value(dossier, table, column)
|
def get_value(dossier, table, column)
|
||||||
assert_valid_column(table, column)
|
|
||||||
|
|
||||||
case table
|
case table
|
||||||
when 'self'
|
when 'self'
|
||||||
dossier.send(column)
|
dossier.send(column)
|
||||||
|
@ -195,12 +193,6 @@ class ProcedurePresentation < ApplicationRecord
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def assert_valid_column(table, column)
|
|
||||||
if !valid_column?(table, column)
|
|
||||||
raise "Invalid column #{table}.#{column}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def valid_column?(table, column)
|
def valid_column?(table, column)
|
||||||
valid_columns_for_table(table).include?(column)
|
valid_columns_for_table(table).include?(column)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue