sequel_enum
sequel_enum copied to clipboard
Feature request: support automatic scope generation
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)