Class: RuboCop::Cop::DatabaseValidations::BelongsTo
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::DatabaseValidations::BelongsTo
- Defined in:
- lib/database_validations/rubocop/cop/belongs_to.rb
Overview
Use db_belongs_to instead of belongs_to.
Constant Summary collapse
- MSG =
'Use `db_belongs_to`.'.freeze
- RESTRICT_ON_SEND =
%i[belongs_to].freeze
- NON_SUPPORTED_OPTIONS =
%i[ optional required polymorphic foreign_type ].freeze
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
26 27 28 29 30 |
# File 'lib/database_validations/rubocop/cop/belongs_to.rb', line 26 def on_send(node) return unless supported?(node) add_offense(node.loc.selector) end |