From 56f366b432f0c1409b4b9e2b74060f48dbc5b995 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Fri, 26 Apr 2013 08:04:22 -0500 Subject: [PATCH] Remove context_specified_by_name from TodosController Use TodoCreateParamsHelper instead to remove the duplication --- app/controllers/todos_controller.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index 000b451c..50e41a7b 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -181,7 +181,7 @@ class TodosController < ApplicationController @project_id = project.id end - if context_specified_by_name(params[:context_name]) + if p.context_specified_by_name? context = current_user.contexts.where(:name => params[:context_name]).first_or_create @new_context_created = context.new_record_before_save? @not_done_todos = [] if @new_context_created @@ -1351,12 +1351,6 @@ class TodosController < ApplicationController end end - def context_specified_by_name(context_name) - return false unless params['context_id'].blank? - return false if context_name.blank? - true - end - def determine_non_uniq_todo # for calendar view. TODO: unused all_list_uniq_ids = (@due_today.map(&:id) + @due_this_week.map(&:id) +