Skip to content

Commit

Permalink
Merge pull request #22766 from kbrock/ruby31-named-parameters
Browse files Browse the repository at this point in the history
Use named arguments for psych 4 support
  • Loading branch information
agrare committed Oct 31, 2023
2 parents 8d9418e + 79e2e5e commit e1341c7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/models/dialog_import_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(dialog_field_association_validator = DialogFieldAssociationValida
end

def determine_validity(import_file_upload)
potential_dialogs = YAML.safe_load(import_file_upload.uploaded_content, [Symbol])
potential_dialogs = YAML.safe_load(import_file_upload.uploaded_content, :permitted_classes => [Symbol])
raise BlankFileError unless potential_dialogs

check_dialogs_for_validity(potential_dialogs)
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/task_helpers/exports/custom_buttons_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
TaskHelpers::Exports::CustomButtons.new.export(:directory => export_dir)
file_contents = File.read("#{export_dir}/CustomButtons.yaml")

expect(YAML.safe_load(file_contents, [Symbol])).to contain_exactly(*custom_button_export_test)
expect(YAML.safe_load(file_contents, :permitted_classes => [Symbol])).to contain_exactly(*custom_button_export_test)
expect(Dir[File.join(export_dir, '**', '*')].count { |file| File.file?(file) }).to eq(1)
end
end
Expand Down Expand Up @@ -164,7 +164,7 @@
TaskHelpers::Exports::CustomButtons.new.export(:directory => export_dir)
file_contents = File.read("#{export_dir}/CustomButtons.yaml")

expect(YAML.safe_load(file_contents, [Symbol])).to contain_exactly(*multi_custom_button_export_test)
expect(YAML.safe_load(file_contents, :permitted_classes => [Symbol])).to contain_exactly(*multi_custom_button_export_test)
expect(Dir[File.join(export_dir, '**', '*')].count { |file| File.file?(file) }).to eq(1)
end
end
Expand Down Expand Up @@ -284,7 +284,7 @@
TaskHelpers::Exports::CustomButtons.new.export(:directory => export_dir)
file_contents = File.read("#{export_dir}/CustomButtons.yaml")

expect(YAML.safe_load(file_contents, [Symbol])).to contain_exactly(*custom_button_with_dialogs_export_test)
expect(YAML.safe_load(file_contents, :permitted_classes => [Symbol])).to contain_exactly(*custom_button_with_dialogs_export_test)
expect(Dir[File.join(export_dir, '**', '*')].count { |file| File.file?(file) }).to eq(1)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/task_helpers/exports/widgets_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
resource_type: MiqReport
enabled: true
read_only: false
", [Symbol], %i(col_order row_count roles)))
", :permitted_classes => [Symbol]))
MiqWidget.sync_from_hash(YAML.safe_load("
description: Test Widget 2
title: Test Widget 2
Expand All @@ -43,7 +43,7 @@
resource_type: MiqReport
enabled: true
read_only: false
", [Symbol], %i(col_order row_count roles)))
", :permitted_classes => [Symbol]))
end

after do
Expand Down
2 changes: 1 addition & 1 deletion spec/models/miq_widget_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
let(:dashboard_name) { "Dashboard for Group" }
before do
@yml_file = Tempfile.new('default_dashboard_for_group.yaml')
yml_data = YAML.safe_load(<<~DOC, [Symbol])
yml_data = YAML.safe_load(<<~DOC, :permitted_classes => [Symbol])
---
name: #{dashboard_name}
read_only: t
Expand Down

0 comments on commit e1341c7

Please sign in to comment.