Class: RuboCop::Cop::Platanus::NoEnumerize

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Defined in:
lib/rubocop/cop/platanus/no_enumerize.rb

Overview

Prefer usage of Rails ‘enum` instead of `Enumerize`

Examples:

# bad
class Foo
  extend Enumerize
  enumerize :bar, in: [:foo, :bar]
end

# good
class Foo
  enum bar: { foo: 0, bar: 1 }
end

Constant Summary collapse

MSG =
'Use Rails `enum` instead of `enumerize`.'

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



45
46
47
48
# File 'lib/rubocop/cop/platanus/no_enumerize.rb', line 45

def on_send(node)
  on_extend_enumerize(node)
  on_enumerize(node)
end