1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Enable Lint/StringConversionInInterpolation rubocop rule

To prevent redundant `to_s` like https://github.com/rails/rails/pull/32923#discussion_r189460008
automatically in the future.
This commit is contained in:
Ryuta Kamizono 2018-05-21 21:04:01 +09:00
parent 15d00f04f4
commit a77447f4da
4 changed files with 7 additions and 4 deletions

View file

@ -162,6 +162,9 @@ Style/UnneededPercentQ:
Lint/RequireParentheses: Lint/RequireParentheses:
Enabled: true Enabled: true
Lint/StringConversionInInterpolation:
Enabled: true
Style/RedundantReturn: Style/RedundantReturn:
Enabled: true Enabled: true
AllowMultipleReturnValues: true AllowMultipleReturnValues: true

View file

@ -104,7 +104,7 @@ module ActiveRecord
if source_line if source_line
if defined?(::Rails.root) if defined?(::Rails.root)
app_root = "#{::Rails.root.to_s}/".freeze app_root = "#{::Rails.root}/"
source_line = source_line.sub(app_root, "") source_line = source_line.sub(app_root, "")
end end

View file

@ -51,11 +51,11 @@ module FakeRecord
end end
def quote_table_name(name) def quote_table_name(name)
"\"#{name.to_s}\"" "\"#{name}\""
end end
def quote_column_name(name) def quote_column_name(name)
"\"#{name.to_s}\"" "\"#{name}\""
end end
def schema_cache def schema_cache

View file

@ -36,7 +36,7 @@ module ApplicationTests
skip "PTY unavailable" unless available_pty? skip "PTY unavailable" unless available_pty?
File.open("#{app_path}/config/boot.rb", "w") do |f| 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'" f.puts "require 'bundler/setup'"
end end