Remove context_specified_by_name from TodosController

Use TodoCreateParamsHelper instead to remove the duplication
This commit is contained in:
Matt Rogers 2013-04-26 08:04:22 -05:00
parent d5dc723ef0
commit 56f366b432

View file

@ -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) +