Skip to content

Commit

Permalink
Enable Lint/StringConversionInInterpolation rubocop rule
Browse files Browse the repository at this point in the history
To prevent redundant `to_s` like rails#32923 (comment)
automatically in the future.
  • Loading branch information
kamipo committed May 21, 2018
1 parent 15d00f0 commit a77447f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ Style/UnneededPercentQ:
Lint/RequireParentheses:
Enabled: true

Lint/StringConversionInInterpolation:
Enabled: true

Style/RedundantReturn:
Enabled: true
AllowMultipleReturnValues: true
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/log_subscriber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def log_query_source

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

Expand Down
4 changes: 2 additions & 2 deletions activerecord/test/cases/arel/support/fake_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def columns(name, message = nil)
end

def quote_table_name(name)
"\"#{name.to_s}\""
"\"#{name}\""
end

def quote_column_name(name)
"\"#{name.to_s}\""
"\"#{name}\""
end

def schema_cache
Expand Down
2 changes: 1 addition & 1 deletion railties/test/application/server_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def teardown
skip "PTY unavailable" unless available_pty?

File.open("#{app_path}/config/boot.rb", "w") do |f|
f.puts "ENV['BUNDLE_GEMFILE'] = '#{Bundler.default_gemfile.to_s}'"
f.puts "ENV['BUNDLE_GEMFILE'] = '#{Bundler.default_gemfile}'"
f.puts "require 'bundler/setup'"
end

Expand Down

0 comments on commit a77447f

Please sign in to comment.