lib/rubocop/cop/polymorphic_associations.rb in gitlab-styles-9.2.0 vs lib/rubocop/cop/polymorphic_associations.rb in gitlab-styles-10.0.0
- old
+ new
@@ -1,18 +1,13 @@
# frozen_string_literal: true
-require_relative '../../gitlab/styles/rubocop/model_helpers'
-
module Rubocop
module Cop
# Cop that prevents the use of polymorphic associations
class PolymorphicAssociations < RuboCop::Cop::Base
- include Gitlab::Styles::Rubocop::ModelHelpers
-
MSG = 'Do not use polymorphic associations, use separate tables instead'
def on_send(node)
- return unless in_model?(node)
return unless node.children[1] == :belongs_to
node.children.last.each_node(:pair) do |pair|
key_name = pair.children[0].children[0]