Ensure case-insensitive fields are converted to lowercase in Admin Imports (#29739)
This commit is contained in:
parent
06fc2b3fde
commit
a3e8b78250
1 changed files with 5 additions and 3 deletions
|
@ -30,12 +30,14 @@ class Admin::Import
|
||||||
|
|
||||||
csv_converter = lambda do |field, field_info|
|
csv_converter = lambda do |field, field_info|
|
||||||
case field_info.header
|
case field_info.header
|
||||||
when '#domain', '#public_comment'
|
when '#domain'
|
||||||
|
field&.downcase&.strip
|
||||||
|
when '#public_comment'
|
||||||
field&.strip
|
field&.strip
|
||||||
when '#severity'
|
when '#severity'
|
||||||
field&.strip&.to_sym
|
field&.downcase&.strip&.to_sym
|
||||||
when '#reject_media', '#reject_reports', '#obfuscate'
|
when '#reject_media', '#reject_reports', '#obfuscate'
|
||||||
ActiveModel::Type::Boolean.new.cast(field)
|
ActiveModel::Type::Boolean.new.cast(field&.downcase)
|
||||||
else
|
else
|
||||||
field
|
field
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue