Skip to content

Commit 5153d98

Browse files
authored
Merge pull request #48 from blocknotes/refactor/minor-change-to-current_host-method
refactor: minor change to `current_host` method
2 parents f8e9b14 + 574c865 commit 5153d98

3 files changed

Lines changed: 2 additions & 4 deletions

File tree

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ AllCops:
1212
- gemfiles/*
1313
- spec/dummy??/**/*
1414
- vendor/**/*
15+
SuggestExtensions: false
1516
TargetRubyVersion: 2.7
1617

1718
Lint/MissingSuper:

lib/active_storage/service/db_service_rails70.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ def compose(source_keys, destination_key, **)
1919

2020
def current_host
2121
opts = url_options || {}
22-
url = "#{opts[:protocol]}#{opts[:host]}"
23-
url += ":#{opts[:port]}" if opts[:port]
24-
url
22+
opts[:port] ? "#{opts[:protocol]}#{opts[:host]}:#{opts[:port]}" : "#{opts[:protocol]}#{opts[:host]}"
2523
end
2624

2725
def private_url(key, expires_in:, filename:, content_type:, disposition:, **)

spec/rails_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252

5353
RSpec.configure do |config|
5454
config.filter_rails_from_backtrace!
55-
config.fixture_path = "#{Rails.root}/spec/fixtures"
5655
config.infer_spec_type_from_file_location!
5756
config.use_transactional_fixtures = true
5857

0 commit comments

Comments
 (0)