Skip to content

Enum: better styling #361

@pirj

Description

@pirj

We suggest the kwargs-style enum definition:

  enum type: {
    credit: 0,
    debit: 1
  }

This is problematic in two ways.

  1. Passing options like prefix/suffix/scopes/default is complicated (needs to be prefixed with an underscore) and is not documented
  2. Results in weird unrelated errors (mentions the very first defined enum instead of the one that has options)

Ok to change this to use positional args for name and values?

  enum :type, {
    credit: 0,
    debit: 1
  }

With options:

  enum :type, {
    credit: 0,
    debit: 1
  }, suffix: true

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions