Ruby

Ruby

Made by DeepSource

Enum detected with array syntax RB-RL1018

Anti-pattern
Major
Autofix

When using array syntax, adding an element in a position other than the last causes all previous definitions to shift. Explicitly specifying the value for each key prevents this from happening.

Bad practice

enum status: [:active, :archived]

Recommended

enum status: { active: 0, archived: 1 }