Sha256: 0d988799cfb137bd0465ea21da10e976f71c21a22353b93143025651f57d2908
Contents?: true
Size: 949 Bytes
Versions: 11
Compression:
Stored size: 949 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Discourse # Use `type: :multisite` example setting instead of modifying `Rails.configuration.multisite`. # # @example # # bad # it "works" do # Rails.configuration.multisite = true # do_something # end # # # good # it "works", type: :multisite do # do_something # end class NoDirectMultisiteManipulation < Cop MSG = "Use `type: :multisite` example setting instead of modifying `Rails.configuration.multisite`." def_node_matcher :multisite_setter?, <<-MATCHER (send (send (const nil? :Rails) :configuration) :multisite= _) MATCHER def on_send(node) return unless multisite_setter?(node) add_offense(node, message: MSG) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems