Class: RuboCop::Cop::Lint::UsePositiveInt32Validator
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Lint::UsePositiveInt32Validator
- Defined in:
- lib/rubocop/cop/lint/use_positive_int32_validator.rb
Overview
Constant Summary collapse
- MSG =
"If this Integer maps to a postgres Integer column, validate with `positive_int32: true`"
Instance Method Summary collapse
Instance Method Details
#on_block(node) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/rubocop/cop/lint/use_positive_int32_validator.rb', line 30 def on_block(node) return unless (hash = find_params_hashes(node)) hash.each do |param| add_offense(param) if is_type_integer?(param) && !validates_integer?(param) end end |