Readme.md in enumify-0.0.1 vs Readme.md in enumify-0.0.2

- old
+ new

@@ -1,7 +1,8 @@ -# Enumify +# Enumify [![Build Status](https://secure.travis-ci.org/yonbergman/enumify.png)](http://travis-ci.org/yonbergman/enumify) + enumify adds an enum command to all ActiveRecord models which enables you to work with string attributes as if they were enums ## Installing Just add the enumify gem to your GemFile @@ -44,8 +45,20 @@ puts "status changed from #{old} to #{new}" end end +## Scopes +One last thing that the enumify gem does is created scope (formerly nested_scopes) so you can easly query by the enum + +For example if you want to count all the events that are canceled you can just run + + Event.canceled.count + +In addition you can also use a negation scope to retrieve all the records that are not set to the given value. +For example to count all the events that are not canceled you can run + + Event.not_canceled.count + --- -Copyright (c) 2011 Yonatan Bergman, released under the MIT license \ No newline at end of file +Copyright (c) 2011 Yonatan Bergman, released under the MIT license