Undev/redmine_my_page_queries — pull request #9 by mattiasa (2013-08-18 10:35:05+00:00)
Title: Include project model when patching user model

Without this patch, I get the following error when go to the welcome page

```
Started GET "/" for 10.11.0.6 at 2013-08-18 12:34:46 +0200
Processing by WelcomeController#index as HTML
Current user: mattiasa (id=49)
Rendered welcome/index.html.erb within layouts/base (5.3ms)
Rendered plugins/redmine_backlogs/app/views/hooks/_rb_include_scripts.html.erb (2.2ms)
Completed 500 Internal Server Error in 77ms

ActionView::Template::Error (undefined method `association_class' for nil:NilClass):
33: <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
34:
35: <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
36:
37: <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
38: <% end %>
39: <%= render_project_jump_box %>
app/helpers/application_helper.rb:268:in `render_project_jump_box'
app/views/layouts/base.html.erb:36:in `_app_views_layouts_base_html_erb___3473142372306840821_60169760'
```
I got the idea for this from http://www.redmine.org/issues/11035#note-15 but I have to admit I haven't really dug into why this occurs.