File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ def create
173173 # The scaler needs to be in place before assigning attributes when the
174174 # scenario inherits from a preset.
175175 @scenario . descale = attrs [ :descale ]
176- @scenario . attributes = attrs . except ( :user_values )
176+ @scenario . attributes = attrs . except ( :user_values , :set_preset_roles )
177177
178178 if current_user . present?
179179 @scenario . scenario_users . build (
@@ -186,10 +186,12 @@ def create
186186 Scenario . transaction do
187187 @scenario . save!
188188
189- if attrs [ :user_values ] . present?
189+ updater_scenario_params = attrs . slice ( :user_values , :set_preset_roles ) . compact_blank
190+
191+ if updater_scenario_params . any?
190192 result = ::ScenarioUpdater . new (
191193 @scenario ,
192- { scenario : { user_values : attrs [ :user_values ] } } ,
194+ { scenario : updater_scenario_params } ,
193195 current_user
194196 ) . call
195197
You can’t perform that action at this time.
0 commit comments