Sha256: 2e82997a6a2185587665143c9a65a864121faed0df53a5490302fdd6b8048c77
Contents?: true
Size: 794 Bytes
Versions: 10
Compression:
Stored size: 794 Bytes
Contents
# frozen_string_literal: true module RailsBestPractices module Reviews # Review model files to make sure not use default_scope # # See the best practice details here https://rails-bestpractices.com/posts/2013/06/15/default_scope-is-evil/ # # Implementation: # # Review process: # check all command node to see if its message is default_scope class DefaultScopeIsEvilReview < Review interesting_nodes :command interesting_files MODEL_FILES url 'https://rails-bestpractices.com/posts/2013/06/15/default_scope-is-evil/' # check all command nodes' message add_callback :start_command do |node| if node.message.to_s == 'default_scope' add_error 'default_scope is evil' end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems