Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Added support to models without database table #19

merged 2 commits into from

4 participants


we needed humanizer for a model without database table and we made this change to support it.
This could be useful, for example, in contact forms that only send mail.

To use this option just add in the model:

include Humanizer

without specifying no method.

Hoping to please.

NebuLab Team


Hi, after a long time I'd like to know if there is something wrong with this pull request.

Please let me know



Not sure if we need this? At least I was able to get it working without this.

In model I had:
include Humanizer
attr_accessor :tip, :humanizer_answer, :humanizer_question_id, :id

And in the controller I was able to ask valid? from the model

Did I misunderstand something here? And sorry for the looooong wait.



We think it was a rails problem (we don't remember a lot about it :) ). Now it's solved and we forgot to close this pull request.

You can always manually fix or accept the other commit (5f01375) that solves an italian translation typo.

p.s. we are currently using your gem in our website and It works like a charm!

Thank you

@kennyadsl kennyadsl closed this

This is not a rails problem. I can concur that when using a ORMless model, such as when implementing a simple contact form, the model.valid? call is not triggered when simply using:

include Humanizer
attr_accessor :humanizer_answer, :humanizer_question_id...

and calling model.is_valid? from the controller. This should be reopened.

@akonan akonan reopened this

Thanks for reopening, I am using @kennyadsl's fork and can verify it works as intended.

@matiaskorhonen matiaskorhonen merged commit 5f01375 into kiskolabs:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 22, 2011
  1. @kennyadsl
Commits on Aug 18, 2011
  1. @kennyadsl

    fixed typo

    kennyadsl authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +1 −1  lib/generators/templates/locales/it.yml
  2. +2 −2 lib/humanizer.rb
2  lib/generators/templates/locales/it.yml
@@ -35,7 +35,7 @@ it:
answers: ["21", "ventuno"]
- question: Che mese viene prima di luglio?
answer: "giugno"
- - question: Quanto fa quindici dviso tre?
+ - question: Quanto fa quindici diviso tre?
answers: ["cinque", "5"]
- question: Quanto fa 14 meno 4?
answers: ["10", "dieci"]
4 lib/humanizer.rb
@@ -50,8 +50,8 @@ def humanizer_check_answer
module ClassMethods
- def require_human_on(validate_on, opts = {})
- opts[:on] = validate_on
+ def require_human_on(validate_on = nil, opts = {})
+ opts[:on] = validate_on if validate_on
validate :humanizer_check_answer, opts
Something went wrong with that request. Please try again.