fix #1268. The default context in the new todo form on the home page is now the first active context

Instead of the first context that could be hidden and thus appear random. Also fix setting the default context based on the project you select.
This commit is contained in:
Reinier Balt 2012-04-03 20:29:58 +02:00
parent 90c80c4330
commit c7637053e1
3 changed files with 7 additions and 5 deletions

View file

@ -18,8 +18,8 @@ class TodosController < ApplicationController
extend ActionView::Helpers::SanitizeHelper::ClassMethods
def index
@projects = current_user.projects.find(:all, :include => [:default_context])
@contexts = current_user.contexts.find(:all)
@projects = current_user.projects.all(:include => [:default_context])
@contexts = current_user.contexts
@contexts_to_show = current_user.contexts.active