Sha256: e468c594d013b92f80796fbe7a9a2cb438b965497b45c3032c12ec8c0737b1f3
Contents?: true
Size: 637 Bytes
Versions: 15
Compression:
Stored size: 637 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Salsify # Check that Activerecord scopes do not use `unscoped` # # @example # # # good # User.strip_default_scope # # # bad # User.unscoped class RailsUnscoped < Cop MSG = 'Explicitly remove scopes instead of using `unscoped`.' def_node_matcher :unscoped?, <<-PATTERN (send _ :unscoped) PATTERN def on_send(node) return unless unscoped?(node) add_offense(node, location: :expression, message: MSG) end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems