README.md in has_enum-0.3.4 vs README.md in has_enum-0.4.0
- old
+ new
@@ -7,11 +7,11 @@
This gem has been designed for Rails 3 only.
### Install gem
Insert
- gem 'has_enum' :git => 'git://github.com/openteam/has_enum.git'
+ gem 'has_enum'
in your Rails 3 Gemfile. Then do
$ bundle install
## Usage
### Models
@@ -20,10 +20,14 @@
has_enum :category, %w( stuff things misc )
has_enum :color , %w( red green blue )
has_enum :size , %w( small medium large ) , :query_methods => false
has_enum :status , [:pending, :failed, :done]
end
+Query methods are available by default. For example, query methods for color enum this methods will be available:
+ color_green?
+ color_red?
+ color_blue?
See [sample usage in specs](https://github.com/openteam/has_enum/blob/master/spec/has_enum_spec.rb).
### Views
radio_button_enum(object_name, method, options = {})
select_enum(object_name, method, options = {})
@@ -65,6 +69,6 @@
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
## Copyright
Copyright (c) 2010 Andreas Korth, Konstantin Shabanov. See LICENSE.txt for
-further details.
\ No newline at end of file
+further details.