Skip to content

Feature request: support automatic scope generation #5

@cmrd-senya

Description

@cmrd-senya

ActiveRecord's enum is capable of automatically generating scopes. Would be nice to have support for the feature here too.

For instance:

class Item < Sequel::Model
  plugin :enum
  enum :condition, [:mint, :good, :poor]
end
Item.mint

equivalent to

Item.where(condition: 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions