Readme.md in enumify-0.0.4 vs Readme.md in enumify-0.0.5
- old
+ new
@@ -37,9 +37,23 @@
# Get all the possible values
Event::STATUSES # returns all available status of the enum
```
+## Options
+#### :allow_nil
+By default the enum field does not support a nil value. In order to allow nil values add the `allow_nil` option (similar to the Rails validation option).
+
+```ruby
+class Event < ActiveRecord::Base
+ enum :status, [:available, :canceled, :completed], :allow_nil => true
+end
+
+Event.create! # Is valid and does not throw an exception.
+```
+
+
+
## Callbacks
Another cool feature of enumify is the option to add a callback function that will be called each time the value of the field changes
This is cool to do stuff like log stuff or create behaviour on state changes
All you need to do is add a x_changed method in your class and the enumify will call it