Nicholas Bruning a47188c9ab Updated gemspec
2013-11-06 10:14:13 +11:00
2013-11-04 23:30:10 +11:00
2013-11-04 23:30:10 +11:00
2013-11-05 10:47:10 +11:00
2013-11-04 23:30:10 +11:00
2013-11-04 23:30:10 +11:00
2013-11-06 10:14:13 +11:00
2013-11-04 23:30:10 +11:00
2013-11-04 23:30:10 +11:00

Mongoid::Enum

Heavily inspired by DHH's ActiveRecord::Enum, this little library is really just a good tablespoon of syntactik sugar.

Usage

class Payment

enum :status, [:pending, :approved, :declined],

end

  • Stores as _status, accessible from status and status=.
  • Automatically validates against :options
  • Stored as a string, but always expressed as a symbol. Access is indifferent (or masks said behaviour

Options

:multiple

Changes storage to _status_array, and allows for the storage of multiple options.

Should also include some finders!

Payment.declined, etc..

Description
Sweet enum sugar for your Mongoid documents
Readme 257 KiB
Languages
Ruby 100%