File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,10 +23,11 @@ def answer_remove_list(answer, user = nil)
2323 id_list = [ ]
2424 return id_list unless answer . question . option_based?
2525
26+ chosen = answer . question_option_ids . sort
27+
2628 answer . question . conditions . each do |cond |
2729 opts = cond . option_list . map ( &:to_i ) . sort
2830 action = cond . action_type
29- chosen = answer . question_option_ids . sort
3031
3132 # If the chosen (options) include the opts (options list) in the condition,
3233 # then we apply the action.
Original file line number Diff line number Diff line change @@ -39,10 +39,10 @@ def deep_copy(**options)
3939 copy = dup
4040 copy . question_id = options . fetch ( :question_id , nil )
4141 # Added to allow options to be passed in for all fields
42- copy . option_list = options . fetch ( :option_list , option_list ) if options . key? ( :option_list )
43- copy . remove_data = options . fetch ( :remove_data , remove_data ) if options . key? ( :remove_data )
44- copy . action_type = options . fetch ( :action_type , action_type ) if options . key? ( :action_type )
45- copy . webhook_data = options . fetch ( :webhook_data , webhook_data ) if options . key? ( :webhook_data )
42+ copy . option_list = options [ :option_list ] if options . key? ( :option_list )
43+ copy . remove_data = options [ :remove_data ] if options . key? ( :remove_data )
44+ copy . action_type = options [ :action_type ] if options . key? ( :action_type )
45+ copy . webhook_data = options [ :webhook_data ] if options . key? ( :webhook_data )
4646 # TODO: why call validate false here
4747 copy . save! ( validate : false ) if options . fetch ( :save , false )
4848 copy
You can’t perform that action at this time.
0 commit comments