From d1ffe59ab5fd6e811833c127d43b32e87b5d7131 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Sat, 27 Jul 2019 12:56:39 +0900 Subject: Use match? where we don't need MatchData We're already running Performance/RegexpMatch cop, but it seems like the cop is not always =~ justice --- railties/lib/rails/command/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails/command') diff --git a/railties/lib/rails/command/base.rb b/railties/lib/rails/command/base.rb index a22b198c66..415bab199f 100644 --- a/railties/lib/rails/command/base.rb +++ b/railties/lib/rails/command/base.rb @@ -52,7 +52,7 @@ module Rails def inherited(base) #:nodoc: super - if base.name && base.name !~ /Base$/ + if base.name && !base.name.match?(/Base$/) Rails::Command.subclasses << base end end -- cgit v1.2.3