aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/time_tables_controller.rb
diff options
context:
space:
mode:
authorcedricnjanga2017-07-21 18:44:46 +0200
committercedricnjanga2017-07-24 17:55:53 +0200
commit82ddf3e15c60de954c9f2ec1bda47e932542ffbf (patch)
tree5f7980b59ae7f0657792f528f28535d6cf3e072a /app/controllers/time_tables_controller.rb
parenta0e2fec830b94a351038324bc90b181dbf199b69 (diff)
downloadchouette-core-82ddf3e15c60de954c9f2ec1bda47e932542ffbf.tar.bz2
Check tt_params[:calendar_id] in Timetable#create
Diffstat (limited to 'app/controllers/time_tables_controller.rb')
-rw-r--r--app/controllers/time_tables_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb
index 6849b1592..8ece4c8ae 100644
--- a/app/controllers/time_tables_controller.rb
+++ b/app/controllers/time_tables_controller.rb
@@ -35,7 +35,7 @@ class TimeTablesController < ChouetteController
def create
tt_params = time_table_params
- if tt_params[:calendar_id]
+ unless tt_params[:calendar_id].empty?
%i(monday tuesday wednesday thursday friday saturday sunday).map { |d| tt_params[d] = true }
calendar = Calendar.find(tt_params[:calendar_id])
tt_params[:calendar_id] = nil if tt_params.has_key?(:dates_attributes) || tt_params.has_key?(:periods_attributes)