bcardarella/client_side_validations — Issue #215: Devise, undefined method `authenticate'
Author: andrusha
Created: 2011-11-07 17:13:26+00:00
State: open

I'm using client_side_validations with devise and uniqueness validator isn't work, what I got is the following exception:

```
A NoMethodError occurred in errors#internal_server_error:

undefined method `authenticate' for nil:NilClass
devise (1.4.7) lib/devise/controllers/helpers.rb:53:in `current_user'

-------------------------------
Request:
-------------------------------
* Parameters: {"case_sensitive"=>"true", "company"=>{"email"=>"company-1320674977@malinator.com"}}

-------------------------------
Session:
-------------------------------

* session id: "738399c67e6f6de6a50c8e02a5827781"
* data: {"session_id"=>"738399c67e6f6de6a50c8e02a5827781",
"_csrf_token"=>"SLpwn/KgxKMVVxuyuhCX0yIDsq8dEdfUmZ1yHzqr72s="}

-------------------------------
Backtrace:
-------------------------------

devise (1.4.7) lib/devise/controllers/helpers.rb:53:in `current_user'
devise (1.4.7) lib/devise/controllers/helpers.rb:49:in `user_signed_in?'
actionpack (3.1.0) lib/abstract_controller/helpers.rb:53:in `user_signed_in?'
app/views/layouts/application_new.html.haml:39:in `_app_views_layouts_application_new_html_haml___2232492416711389938_56583200'
actionpack (3.1.0) lib/action_view/template.rb:144:in `block in render'
activesupport (3.1.0) lib/active_support/notifications.rb:55:in `instrument'
actionpack (3.1.0) lib/action_view/template.rb:142:in `render'
```

I tried to follow devise guide from wiki, but including `devise` directive to my models didn't help.