Class: Hyrax::RuboCop::CustomCops::ArResource

Inherits:
RuboCop::Cop::Cop
  • Object
show all
Defined in:
lib/hyrax/rubocop/custom_cops.rb

Overview

This custom cop checks for mixins of Hyrax::ArResource

Constant Summary collapse

MSG =
'Do not `include Hyrax::ArResource`.'

Instance Method Summary collapse

Instance Method Details

#on_send(send_node) ⇒ Object



22
23
24
# File 'lib/hyrax/rubocop/custom_cops.rb', line 22

def on_send(send_node)
  add_offense(send_node, message: MSG) if includes_hyrax_ar_resource?(send_node) || includes_ar_resource?(send_node)
end