aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/metal/conditional_get.rb2
-rw-r--r--actionpack/lib/action_controller/metal/content_security_policy.rb2
-rw-r--r--actionpack/lib/action_dispatch/http/feature_policy.rb2
-rw-r--r--actionpack/lib/action_dispatch/system_testing/browser.rb4
4 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/metal/conditional_get.rb b/actionpack/lib/action_controller/metal/conditional_get.rb
index 29d1919ec5..f21e51a68a 100644
--- a/actionpack/lib/action_controller/metal/conditional_get.rb
+++ b/actionpack/lib/action_controller/metal/conditional_get.rb
@@ -17,7 +17,7 @@ module ActionController
# of cached pages.
#
# class InvoicesController < ApplicationController
- # etag { current_user.try :id }
+ # etag { current_user&.id }
#
# def show
# # Etag will differ even for the same invoice when it's viewed by a different current_user
diff --git a/actionpack/lib/action_controller/metal/content_security_policy.rb b/actionpack/lib/action_controller/metal/content_security_policy.rb
index ebd90f07c8..25fc110bfe 100644
--- a/actionpack/lib/action_controller/metal/content_security_policy.rb
+++ b/actionpack/lib/action_controller/metal/content_security_policy.rb
@@ -45,7 +45,7 @@ module ActionController #:nodoc:
end
def current_content_security_policy
- request.content_security_policy.try(:clone) || ActionDispatch::ContentSecurityPolicy.new
+ request.content_security_policy&.clone || ActionDispatch::ContentSecurityPolicy.new
end
end
end
diff --git a/actionpack/lib/action_dispatch/http/feature_policy.rb b/actionpack/lib/action_dispatch/http/feature_policy.rb
index 78e982918d..c09690f9fc 100644
--- a/actionpack/lib/action_dispatch/http/feature_policy.rb
+++ b/actionpack/lib/action_dispatch/http/feature_policy.rb
@@ -42,7 +42,7 @@ module ActionDispatch #:nodoc:
end
def policy_empty?(policy)
- policy.try(:directives) && policy.directives.empty?
+ policy&.directives&.empty?
end
end
diff --git a/actionpack/lib/action_dispatch/system_testing/browser.rb b/actionpack/lib/action_dispatch/system_testing/browser.rb
index e861e52f09..91f332be13 100644
--- a/actionpack/lib/action_dispatch/system_testing/browser.rb
+++ b/actionpack/lib/action_dispatch/system_testing/browser.rb
@@ -47,14 +47,14 @@ module ActionDispatch
case type
when :chrome
if ::Selenium::WebDriver::Service.respond_to? :driver_path=
- ::Selenium::WebDriver::Chrome::Service.driver_path.try(:call)
+ ::Selenium::WebDriver::Chrome::Service.driver_path&.call
else
# Selenium <= v3.141.0
::Selenium::WebDriver::Chrome.driver_path
end
when :firefox
if ::Selenium::WebDriver::Service.respond_to? :driver_path=
- ::Selenium::WebDriver::Firefox::Service.driver_path.try(:call)
+ ::Selenium::WebDriver::Firefox::Service.driver_path&.call
else
# Selenium <= v3.141.0
::Selenium::WebDriver::Firefox.driver_path