README.md in humanizer-2.2.0 vs README.md in humanizer-2.3.0
- old
+ new
@@ -15,30 +15,39 @@
## Usage
1. In your model, include Humanizer and add the #require_human_on method, example:
- class User < ActiveRecord::Base
- include Humanizer
- require_human_on :create
- end
+ class User < ActiveRecord::Base
+ include Humanizer
+ require_human_on :create
+ end
2. Ask the question in the form, example:
- <%= f.label :humanizer_answer, @model.humanizer_question %>
- <%= f.text_field :humanizer_answer %>
- <%= f.hidden_field :humanizer_question_id %>
+ <%= f.label :humanizer_answer, @model.humanizer_question %>
+ <%= f.text_field :humanizer_answer %>
+ <%= f.hidden_field :humanizer_question_id %>
+3. If you are using attr_accessible, remember to whitelist `:humanizer_answer` and `:humanizer_question_id`.
+
## Configuration
Default translations can be found in config/locales/
You might want to add/change question and answer pairs. This can be easily done by adding/modifying entries in locales file.
## Skipping validation
-Set the attribute 'real_human' to true on the object you want to skip the Humanizer validation. Handy for testing or console use.
+You might want to skip the humanizer validations on your tests or rails console.
+You can just have a simple attribute on your model and use it to bypass the validation. Here's an example:
+
+ attr_accessor :bypass_humanizer
+ require_human_on :create, :unless => :bypass_humanizer
+
+Now when bypass_humanizer is true, validation will be skipped.
+
## Live sites
* [ArcticStartup.com](http://arcticstartup.com/) - signup form
## License