amatsuda/html5_validators

undefined method `auto_html5_validation' for Active Model

Opened this issue · 2 comments

Ana06 commented

From my spider test:

[979faece-c1e5-4d78-ac39-0b73b12863c4] [299:68.43] ActionView::Template::Error (undefined method `auto_html5_validation' for Patchinfo:Class):
[979faece-c1e5-4d78-ac39-0b73b12863c4] [299:68.43]     11:             %strong
[979faece-c1e5-4d78-ac39-0b73b12863c4]     12:               = f.label(:packager, 'Packager:')
[979faece-c1e5-4d78-ac39-0b73b12863c4]     13:             %br/
[979faece-c1e5-4d78-ac39-0b73b12863c4]     14:             = f.text_field :packager, required: true
[979faece-c1e5-4d78-ac39-0b73b12863c4]     15:             :javascript
[979faece-c1e5-4d78-ac39-0b73b12863c4]     16:               $("#packager").autocomplete({source: '#{url_for controller: 'user', action: 'autocomplete'}', search: function(event, ui) {
[979faece-c1e5-4d78-ac39-0b73b12863c4]     17:                 $(this).addClass('loading-spinner');
[979faece-c1e5-4d78-ac39-0b73b12863c4] [299:68.43]   
[979faece-c1e5-4d78-ac39-0b73b12863c4] [299:68.43] app/views/webui/patchinfo/_form.html.haml:14:in `block in _app_views_webui_patchinfo__form_html_haml__1383717022713791384_47354342968160'
[979faece-c1e5-4d78-ac39-0b73b12863c4] app/views/webui/patchinfo/_form.html.haml:2:in `_app_views_webui_patchinfo__form_html_haml__1383717022713791384_47354342968160'
[979faece-c1e5-4d78-ac39-0b73b12863c4] app/views/webui/patchinfo/edit.html.haml:3:in `_app_views_webui_patchinfo_edit_html_haml__1907723402339578054_47354343006520'
[979faece-c1e5-4d78-ac39-0b73b12863c4] config/initializers/wrap_parameters.rb:38:in `call'
[979faece-c1e5-4d78-ac39-0b73b12863c4] test/functional/webui/spider_test.rb:99:in `crawl'
[979faece-c1e5-4d78-ac39-0b73b12863c4] test/functional/webui/spider_test.rb:161:in `test_spider_as_admin'
[979faece-c1e5-4d78-ac39-0b73b12863c4] test/test_helper.rb:118:in `block in __run'
[979faece-c1e5-4d78-ac39-0b73b12863c4] test/test_helper.rb:118:in `map'
[979faece-c1e5-4d78-ac39-0b73b12863c4] test/test_helper.rb:118:in `__run'

It only fails for Active Model, not for Active Record.

@Ana06 Thank you very much for the information!
Could you please tell me more details? I personally don't use Active Model without Active Record, so I've never seen this happening.

Ana06 commented

@amatsuda

Could you please tell me more details?

The error is a bit wierd. It doesn't fail when I visit the page, but it does fail in the spider test (even if I disable it). You can see the code and the test failure in this PR:

openSUSE/open-build-service#7471