aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorZog2018-04-13 11:06:27 +0200
committerZog2018-04-13 11:06:27 +0200
commit13087614ceb0e9e3a604cd08a023f11cd0567bea (patch)
tree530f9cca1642fedc0c8a3ece201357ba6c4762b7 /app
parent94090e82bfb5f875f70aa1e8bffb8a51724eb760 (diff)
downloadchouette-core-13087614ceb0e9e3a604cd08a023f11cd0567bea.tar.bz2
Refs #6536; Cleanup value passed for secondary_company_ids by the lines form6536-fix-lines-form
Diffstat (limited to 'app')
-rw-r--r--app/controllers/lines_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb
index ae8c9ed0c..cd8091252 100644
--- a/app/controllers/lines_controller.rb
+++ b/app/controllers/lines_controller.rb
@@ -122,7 +122,7 @@ class LinesController < ChouetteController
end
def line_params
- params.require(:line).permit(
+ out = params.require(:line).permit(
:transport_mode,
:network_id,
:company_id,
@@ -148,6 +148,8 @@ class LinesController < ChouetteController
:secondary_company_ids => [],
footnotes_attributes: [:code, :label, :_destroy, :id]
)
+ out[:secondary_company_ids] = (out[:secondary_company_ids] || []).select(&:present?)
+ out
end
# Fake ransack filter