mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-04 16:28:50 +01:00
#300: Fixed bug where description containing dots were not possible to add as predecessors.
This commit is contained in:
parent
4ac3632fb9
commit
db4c848512
1 changed files with 7 additions and 4 deletions
|
|
@ -93,10 +93,13 @@ class Todo < ActiveRecord::Base
|
|||
# Split specification into parts: description <context, project>
|
||||
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?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue