From 5631f139c1f6f923923a82f8c55d5ab0820a2788 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 1 Dec 2023 10:53:35 -0500 Subject: [PATCH] Fix `Lint/SymbolConversion` cop (#28175) --- app/models/concerns/remotable.rb | 2 +- app/models/user_settings/setting.rb | 2 +- config/deploy.rb | 2 +- spec/models/concerns/remotable_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/concerns/remotable.rb b/app/models/concerns/remotable.rb index cb8f46e688..bd8b6f4eb9 100644 --- a/app/models/concerns/remotable.rb +++ b/app/models/concerns/remotable.rb @@ -5,7 +5,7 @@ module Remotable class_methods do def remotable_attachment(attachment_name, limit, suppress_errors: true, download_on_assign: true, attribute_name: nil) - attribute_name ||= "#{attachment_name}_remote_url".to_sym + attribute_name ||= :"#{attachment_name}_remote_url" define_method("download_#{attachment_name}!") do |url = nil| url ||= self[attribute_name] diff --git a/app/models/user_settings/setting.rb b/app/models/user_settings/setting.rb index 9c17017440..1ab6cbeab2 100644 --- a/app/models/user_settings/setting.rb +++ b/app/models/user_settings/setting.rb @@ -62,7 +62,7 @@ class UserSettings::Setting def key if namespace - "#{namespace}.#{name}".to_sym + :"#{namespace}.#{name}" else name end diff --git a/config/deploy.rb b/config/deploy.rb index b19567a729..75bfcc26f4 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -20,7 +20,7 @@ namespace :systemd do SYSTEMD_SERVICES.each do |service| SERVICE_ACTIONS.each do |action| desc "Perform a #{action} on #{service} service" - task "#{service}:#{action}".to_sym do + task :"#{service}:#{action}" do on roles(:app) do # runs e.g. "sudo restart mastodon-sidekiq.service" sudo :systemctl, action, "#{fetch(:application)}-#{service}.service" diff --git a/spec/models/concerns/remotable_spec.rb b/spec/models/concerns/remotable_spec.rb index db690da3c2..9f6aeb7fb4 100644 --- a/spec/models/concerns/remotable_spec.rb +++ b/spec/models/concerns/remotable_spec.rb @@ -31,7 +31,7 @@ RSpec.describe Remotable do end end - let(:attribute_name) { "#{hoge}_remote_url".to_sym } + let(:attribute_name) { :"#{hoge}_remote_url" } let(:code) { 200 } let(:file) { 'filename="foo.txt"' } let(:foo) { foo_class.new }