Class: RuboCop::Cop::Captive::StringWhereInScope
- Inherits:
-
RuboCop::Cop::Cop
- Object
- RuboCop::Cop::Cop
- RuboCop::Cop::Captive::StringWhereInScope
- Defined in:
- lib/rubocop/cop/captive/string_where_in_scope.rb
Constant Summary collapse
- MSG =
'The `where` method should be used in a scope in a model.'
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/rubocop/cop/captive/string_where_in_scope.rb', line 13 def on_send(node) return unless where_with_string?(node) = node.arguments[0] return if &.hash_type? add_offense(, message: MSG) end |