From a77447f4da15dd3c2b02563fa6f5769c1d91e1bd Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Mon, 21 May 2018 21:04:01 +0900 Subject: Enable `Lint/StringConversionInInterpolation` rubocop rule To prevent redundant `to_s` like https://github.com/rails/rails/pull/32923#discussion_r189460008 automatically in the future. --- activerecord/lib/active_record/log_subscriber.rb | 2 +- activerecord/test/cases/arel/support/fake_record.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/log_subscriber.rb b/activerecord/lib/active_record/log_subscriber.rb index 013c3765b2..cf884bc6da 100644 --- a/activerecord/lib/active_record/log_subscriber.rb +++ b/activerecord/lib/active_record/log_subscriber.rb @@ -104,7 +104,7 @@ module ActiveRecord if source_line if defined?(::Rails.root) - app_root = "#{::Rails.root.to_s}/".freeze + app_root = "#{::Rails.root}/" source_line = source_line.sub(app_root, "") end diff --git a/activerecord/test/cases/arel/support/fake_record.rb b/activerecord/test/cases/arel/support/fake_record.rb index 8620d6fd34..559ff5d4e6 100644 --- a/activerecord/test/cases/arel/support/fake_record.rb +++ b/activerecord/test/cases/arel/support/fake_record.rb @@ -51,11 +51,11 @@ module FakeRecord end def quote_table_name(name) - "\"#{name.to_s}\"" + "\"#{name}\"" end def quote_column_name(name) - "\"#{name.to_s}\"" + "\"#{name}\"" end def schema_cache -- cgit v1.2.3