jeromemacias/webistrano — Issue #1: Error 500 after login when no rights
Author: zedtux
Created: 2012-02-08 10:03:33+00:00
State: open

When a user has no rights, and he log in, then he have a 500 error.

## backtrace

````bash
ActionView::TemplateError (undefined method `empty?' for nil:NilClass) on line #28 of app/views/projects/dashboard.html.erb:
25:
26:

27:
Recent deployments

28: <% if @deployments.empty? %>
29:

30: No recent deployments.
31:

app/views/projects/dashboard.html.erb:28
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_view/renderable.rb:34:in `block in render'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_view/base.rb:306:in `with_template'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_view/renderable.rb:30:in `render'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_view/template.rb:205:in `render_template'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_view/base.rb:265:in `render'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_view/base.rb:348:in `_render_with_layout'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_view/base.rb:262:in `render'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/base.rb:1252:in `render_for_file'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/base.rb:942:in `render'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/benchmarking.rb:51:in `block in render_with_benchmark'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/benchmarking.rb:51:in `render_with_benchmark'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/mime_responds.rb:135:in `block in custom'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/mime_responds.rb:179:in `call'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/mime_responds.rb:179:in `block in respond'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/mime_responds.rb:173:in `each'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/mime_responds.rb:173:in `respond'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/mime_responds.rb:107:in `respond_to'
app/controllers/projects_controller.rb:15:in `dashboard'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/base.rb:1333:in `perform_action'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/filters.rb:617:in `call_filters'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/filters.rb:638:in `block in run_before_filters'
app/controllers/application_controller.rb:23:in `set_timezone'
bundle/ruby/1.9.1/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:178:in `evaluate_method'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/filters.rb:186:in `call'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/filters.rb:635:in `run_before_filters'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/filters.rb:615:in `call_filters'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/base.rb:532:in `process'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/filters.rb:606:in `process_with_filters'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/base.rb:391:in `process'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/base.rb:386:in `call'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb:438:in `call'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:87:in `dispatch'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:121:in `_call'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack'
bundle/ruby/1.9.1/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:29:in `call'
bundle/ruby/1.9.1/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:29:in `block in call'
bundle/ruby/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
bundle/ruby/1.9.1/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:9:in `cache'
bundle/ruby/1.9.1/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:28:in `call'
bundle/ruby/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/string_coercion.rb:25:in `call'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/params_parser.rb:15:in `call'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/session/cookie_store.rb:99:in `call'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/failsafe.rb:26:in `call'
:10:in `synchronize'
bundle/ruby/1.9.1/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:106:in `call'
bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:80:in `block in pre_process'
bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:78:in `catch'
bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:78:in `pre_process'
bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:53:in `process'
bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:38:in `receive_data'
bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start'
bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/server.rb:159:in `start'
bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/controllers/controller.rb:86:in `start'
bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/runner.rb:185:in `run_command'
bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/runner.rb:151:in `run!'
bundle/ruby/1.9.1/gems/thin-1.3.1/bin/thin:6:in `'
bundle/ruby/1.9.1/bin/thin:19:in `load'
bundle/ruby/1.9.1/bin/thin:19:in `

'
````