Skip to content

Commit 47bdf7a

Browse files
Merge pull request #9215 from jrafanie/rails7_compatible_changes
Rails 7 compatible changes (part 1)
2 parents b01813b + fd97e9f commit 47bdf7a

27 files changed

+42
-45
lines changed

app/controllers/ops_controller/settings/common.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ def pglogical_save_subscriptions
182182
task_opts = {:action => "Save subscriptions for global region", :userid => session[:userid]}
183183
queue_opts = {:class_name => "MiqPglogical", :method_name => "save_global_region",
184184
:args => [subscriptions_to_save, subsciptions_to_remove]}
185-
ActiveRecord::Base.yaml_column_permitted_classes |= [subscriptions_to_save.first.class, subsciptions_to_remove.first.class]
185+
if ActiveRecord.respond_to?(:yaml_column_permitted_classes)
186+
ActiveRecord.yaml_column_permitted_classes = YamlPermittedClasses.app_yaml_permitted_classes | [subscriptions_to_save.first.class, subsciptions_to_remove.first.class]
187+
else
188+
ActiveRecord::Base.yaml_column_permitted_classes = YamlPermittedClasses.app_yaml_permitted_classes | [subscriptions_to_save.first.class, subsciptions_to_remove.first.class]
189+
end
186190
when "remote"
187191
task_opts = {:action => "Configure the database to be a replication remote region",
188192
:userid => session[:userid]}

spec/views/availability_zone/show.html.haml_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
describe "availability_zone/show.html.haml" do
22
shared_examples_for "miq_before_onload JS is needed" do
33
it "renders proper JS" do
4-
js_string = "ManageIQ.afterOnload = {action: () => miqAsyncAjax(\"/availability_zone/#{action}/#{availability_zone.id}\")}"
4+
template_path = "availability_zone/#{action}"
5+
js_string = "ManageIQ.afterOnload = {action: () => miqAsyncAjax(\"/#{template_path}/#{availability_zone.id}\")}"
56

6-
render
7+
render :template => template_path
78
expect(rendered).to include(js_string)
89
end
910
end
1011

1112
let(:availability_zone) { double("AvailabilityZone", :name => 'My AZ', :id => 1) }
12-
let(:action) { 'index' }
13+
let(:action) { 'show' }
1314

1415
before do
1516
assign(:record, availability_zone)

spec/views/catalog/_form.html.haml_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
end
1818

1919
it "Renders form when adding catalog bundle and st_prov_type is not set" do
20-
render
20+
render :template => "catalog/_form"
2121
expect(response).to render_template(:partial => "catalog/_form_basic_info")
2222
end
2323
end

spec/views/catalog/_sandt_tree_show.html.haml_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
end
1414

1515
it "Renders bundle summary screen" do
16-
render
16+
render :template => "catalog/_sandt_tree_show"
1717
expect(rendered).to include(bundle.name)
1818
expect(rendered).to include(bundle.tenant.name)
1919
end

spec/views/dashboard/login.html.haml_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
end
99

1010
it "when authentication is 'database'" do
11-
render
11+
render :template => "dashboard/login"
1212
expect(response).to have_selector("form#login_div:has(input#browser_name)")
1313
expect(response).to have_selector("form#login_div:has(input#browser_version)")
1414
expect(response).to have_selector("form#login_div:has(input#browser_os)")
1515
expect(response).to have_selector("form#login_div:has(input#user_TZO)")
1616
end
1717

1818
it "when authentication is not 'database'" do
19-
render
19+
render :template => "dashboard/login"
2020
expect(response).to have_selector("form#login_div:has(input#browser_name)")
2121
expect(response).to have_selector("form#login_div:has(input#browser_version)")
2222
expect(response).to have_selector("form#login_div:has(input#browser_os)")
@@ -33,15 +33,15 @@
3333

3434
it "show" do
3535
stub_settings(:server => {}, :session => {:show_login_info => true}, :authentication => {})
36-
render
36+
render :template => "dashboard/login"
3737
labels.each do |label|
3838
expect(response).to have_selector('p', :text => label)
3939
end
4040
end
4141

4242
it "hide" do
4343
stub_settings(:server => {}, :session => {:show_login_info => false}, :authentication => {})
44-
render
44+
render :template => "dashboard/login"
4545
labels.each do |label|
4646
expect(response).not_to have_selector('p', :text => label)
4747
end

spec/views/ems_cluster/show.html.haml_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
let(:showtype) { 'drift' }
1616

1717
it 'should render the compare partial' do
18-
render
18+
render :template => "ems_cluster/show"
1919
expect(response).to render_template(:partial => 'layouts/_compare')
2020
end
2121
end

spec/views/host/_show.html.haml_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
shared_examples_for "miq_before_onload JS is needed" do
66
it "renders proper JS" do
77
js_string = "ManageIQ.afterOnload = {action: () => miqAsyncAjax(\"/host/#{action}/#{host.id}\")}"
8-
render
8+
render :template => "host/show"
99
expect(rendered).to include(js_string)
1010
end
1111
end
@@ -46,7 +46,7 @@
4646
it "should render gtl view" do
4747
assign(:lastaction, "host_services")
4848
assign(:view, OpenStruct.new(:table => OpenStruct.new(:data => [])))
49-
render
49+
render :template => "host/show"
5050
expect(view).to render_template(:partial => 'layouts/gtl', :locals => {:action_url => 'host_services'})
5151
end
5252
end

spec/views/layouts/_center_div_no_listnav.html.haml_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
end
1212

1313
it 'renders Search bar' do
14-
render
14+
render :template => "layouts/_center_div_no_listnav"
1515
expect(rendered).to include('SearchBar')
1616
end
1717
end

spec/views/layouts/_item.html.haml_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
assign(:view, FactoryBot.create(:miq_report_filesystem))
66
assign(:item, fs)
77
assign(:lastaction, 'filesystems')
8-
render
8+
render :template => "layouts/_item"
99

1010
expect(response).to have_selector('label', :text => 'Name')
1111
expect(response).to have_selector('label', :text => 'File Name')

spec/views/layouts/_searchbar.html.haml_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
end
66

77
it 'renders Search bar and not quick search' do
8-
render
8+
render :template => "layouts/_searchbar"
99
expect(rendered).to include('SearchBar')
1010
expect(rendered).not_to include('quicksearchbox')
1111
end
1212

1313
it 'renders Advanced Search and quick search' do
1414
allow(view).to receive(:display_adv_search?).and_return(true)
15-
render
15+
render :template => "layouts/_searchbar"
1616
expect(rendered).to include('quicksearchbox')
1717
end
1818
end

0 commit comments

Comments
 (0)