Skip to content

Commit d66f688

Browse files
committed
Don't load the active_support blank core extension
Rubocop already defined its own `blank?` method (🙁), so ruby always warns when it is loaded again. There's no real point in using the extension though, so just not using it seems ideal.
1 parent 332ef79 commit d66f688

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

lib/rubocop-rails.rb

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
require 'rubocop'
44
require 'rack/utils'
55
require 'active_support/inflector'
6-
require 'active_support/core_ext/object/blank'
76

87
require_relative 'rubocop/rails'
98
require_relative 'rubocop/rails/version'

lib/rubocop/cop/mixin/database_type_resolvable.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def database_from_yaml
2929
end
3030

3131
def database_from_env
32-
url = ENV['DATABASE_URL'].presence
33-
return unless url
32+
url = ENV.fetch('DATABASE_URL', '')
33+
return if url.blank?
3434

3535
case url
3636
when %r{\A(mysql2|trilogy)://}

lib/rubocop/cop/rails/reflection_class_name.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def reflection_class_value?(class_value)
7676
def autocorrect(corrector, class_config)
7777
class_value = class_config.value
7878
replacement = const_or_string(class_value)
79-
return unless replacement.present?
79+
return unless replacement
8080

8181
corrector.replace(class_value, replacement.source.inspect)
8282
end

lib/rubocop/cop/rails/schema_comment.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class SchemaComment < Base
3939

4040
# @!method comment_present?(node)
4141
def_node_matcher :comment_present?, <<~PATTERN
42-
(hash <(pair {(sym :comment) (str "comment")} (_ [present?])) ...>)
42+
(hash <(pair {(sym :comment) (str "comment")} (_ !blank?)) ...>)
4343
PATTERN
4444

4545
# @!method add_column?(node)

0 commit comments

Comments
 (0)