Class: Rails::Cops::ModelEnumSetting
- Inherits:
-
RuboCop::Cop::Base
- Object
- RuboCop::Cop::Base
- Rails::Cops::ModelEnumSetting
- Defined in:
- lib/rails/cops/model_enum_setting.rb
Overview
This is for custom rubocop rule for model enum
Instance Method Summary collapse
-
#on_send(node) ⇒ Object
event handler.
Instance Method Details
#on_send(node) ⇒ Object
event handler
17 18 19 20 21 22 23 |
# File 'lib/rails/cops/model_enum_setting.rb', line 17 def on_send(node) enum_matcher(node) do |matches| next if matches.any? { |pair| pair.key.value.to_s.end_with?('_prefix', '_suffix') } add_offense(node, message: MSG) end end |