Permalink
Browse files

More tweaks.

  • Loading branch information...
1 parent f751b0b commit aeb49f840a1890e5f2f874eabad59e4c844a24a1 @kenn committed Sep 17, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 README.md
View
@@ -1,6 +1,6 @@
# EnumAccessor - Simple enum fields for ActiveRecord
-EnumAccessor lets you define enum for attributes, and store them as integer-encoded values.
+EnumAccessor lets you define enum for attributes, and store them as integer in the database.
Compatible with ActiveRecord 3 or later.
@@ -33,7 +33,7 @@ And now you have a set of methods and constants.
```ruby
user = User.new
user.gender # => :female
-user.gender_female? # => true
+user.gender_male? # => false
user.gender_raw # => 0
user.gender = :male
@@ -44,6 +44,8 @@ User.genders # => { :female => 0, :male => 1 }
User::GENDERS # => { "female" => 0, "male" => 1 }
```
+Notice that zero-based numbering is used for database values.
+
## Manual coding
There are times when it makes more sense to manually pick particular integers for the mapping.

0 comments on commit aeb49f8

Please sign in to comment.