From cb8aba80ca528b5b5f359db7efe280a93d7d8061 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Tue, 1 Jul 2014 22:38:23 +0200 Subject: [PATCH] fix #1462 I do not understand why this works for daily but not for weekly repeating todos --- app/models/recurring_todos/abstract_recurring_todos_builder.rb | 1 - lib/tracks/attribute_handler.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/recurring_todos/abstract_recurring_todos_builder.rb b/app/models/recurring_todos/abstract_recurring_todos_builder.rb index 67b55aef..fb300d03 100644 --- a/app/models/recurring_todos/abstract_recurring_todos_builder.rb +++ b/app/models/recurring_todos/abstract_recurring_todos_builder.rb @@ -15,7 +15,6 @@ module RecurringTodos @pattern = pattern_class.new(user) @pattern.attributes = @mapped_attributes - end # build does not add tags. For tags, the recurring todos needs to be saved diff --git a/lib/tracks/attribute_handler.rb b/lib/tracks/attribute_handler.rb index add42787..43f36be8 100644 --- a/lib/tracks/attribute_handler.rb +++ b/lib/tracks/attribute_handler.rb @@ -52,7 +52,7 @@ module Tracks if specified_by_name?(object_type) object, new_object_created = find_or_create_by_name(relation, object_name(object_type)) # put id of object in @attributes, i.e. set :project_id to project.id - @attributes[object_type.to_s + "_id"] = object.id unless new_object_created + @attributes["#{object_type.to_s}_id".to_sym] = object.id unless new_object_created else # find context or project by its id object = attribute_with_id_of(object_type).present? ? relation.find(attribute_with_id_of(object_type)) : nil