我有jnunemaker-validatable gem,因为我使用的是mongo-mapper,我发现我不能在for param上使用:validates_acceptance_of帮助器。它死于:
ArgumentError: invalid options: on
from /opt/local/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.4/lib/validatable/understandable.rb:27:in `must_understand'
from /opt/local/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.4/lib/validatable/validations/validation_base.rb:47:in `initialize'
from /opt/local/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.4/lib/validatable/validatable_class_methods.rb:66:in `new'
from /opt/local/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.4/lib/validatable/validatable_class_methods.rb:66:in `add_validations'
from /opt/local/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.4/lib/validatable/validatable_class_methods.rb:65:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.4/lib/validatable/validatable_class_methods.rb:65:in `add_validations'
from /opt/local/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.4/lib/validatable/macros.rb:119:in `validates_acceptance_of'
有什么想法吗?有人有解决方法吗?我会将这个问题发送给项目,但我找不到与之交互的方法(没有论坛/ bugtracker /等)。
谢谢! 汤姆
答案 0 :(得分:0)
我建议升级到mongomapper v0.9.1,它使用ActiveRecord :: Validations而不是不支持:on选项的Validatable gem。
如果您想与项目进行互动,您可以考虑询问mongomapper google群组:http://groups.google.com/group/mongomapper或者可能只是在可验证的gem github项目中提交错误:https://github.com/jnunemaker/validatable但是我希望你得到一个类似的回复,敦促你升级到最新版本的MongoMapper。