From db4c848512050291373b9ac42f9ee14948a284a1 Mon Sep 17 00:00:00 2001 From: Henrik Bohre Date: Thu, 20 Aug 2009 11:00:22 +0200 Subject: [PATCH] #300: Fixed bug where description containing dots were not possible to add as predecessors. --- app/models/todo.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/models/todo.rb b/app/models/todo.rb index b73d19c0..6bb1cf94 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -93,10 +93,13 @@ class Todo < ActiveRecord::Base # Split specification into parts: description parts = specification.split(%r{\ \<|; |\>}) return nil unless parts.length == 3 - todos = Todo.all(:joins => [:project, :context], - :include => [:context, :project], - :conditions => {:description => parts[0], - :contexts => {:name => parts[1]}}) + todos = Todo.all( + :joins => [:project, :context], + :conditions => { + :description => parts[0], + :contexts => {:name => parts[1]} + } + ) return nil if todos.empty? # todos now contains all todos with matching description and context # TODO: Is this possible to do with a single query?