diff options
author | Matt Jankowski <matt@jankowski.online> | 2023-11-28 04:17:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-28 09:17:26 +0000 |
commit | baf3b71e3b881a2143c983ce71646ae3a8262086 (patch) | |
tree | f26a3335235978e2d3838e97083cc7c2c8baf14a | |
parent | c824d98ceccda299190ebe1364ffd8bd2a8e330c (diff) |
Extract `path_without_format` private methd in accounts controller (#28091)
-rw-r--r-- | app/controllers/accounts_controller.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index b0f97317203..850bf881ffa 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -85,14 +85,18 @@ class AccountsController < ApplicationController helper_method :rss_url def media_requested? - request.path.split('.').first.end_with?('/media') && !tag_requested? + path_without_format.end_with?('/media') && !tag_requested? end def replies_requested? - request.path.split('.').first.end_with?('/with_replies') && !tag_requested? + path_without_format.end_with?('/with_replies') && !tag_requested? end def tag_requested? - request.path.split('.').first.end_with?(Addressable::URI.parse("/tagged/#{params[:tag]}").normalize) + path_without_format.end_with?(Addressable::URI.parse("/tagged/#{params[:tag]}").normalize) + end + + def path_without_format + request.path.split('.').first end end |