mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-13 07:56:17 +01:00
Merge branch 'master' into new-gui
Conflicts: Gemfile.lock
This commit is contained in:
parent
fa537fbeb0
commit
eb1502d4e0
28 changed files with 385 additions and 221 deletions
|
|
@ -14,6 +14,10 @@ class TodoFromRichMessage
|
|||
description = extractor.description
|
||||
context = extractor.context
|
||||
project = extractor.project
|
||||
show_from = extractor.show_from
|
||||
due = extractor.due
|
||||
tags = extractor.tags
|
||||
star = extractor.starred?
|
||||
|
||||
context_id = default_context_id
|
||||
if context.present?
|
||||
|
|
@ -33,17 +37,21 @@ class TodoFromRichMessage
|
|||
found_project.name = project[4..259].strip
|
||||
found_project.save!
|
||||
else
|
||||
found_project = user.projects.active.find_by_namepart(project)
|
||||
found_project = user.projects.find_by_namepart(project) if found_project.nil?
|
||||
found_project = user.projects.active.with_namepart(project).first
|
||||
found_project = user.projects.with_namepart(project).first if found_project.nil?
|
||||
end
|
||||
project_id = found_project.id unless found_project.nil?
|
||||
end
|
||||
|
||||
todo = user.todos.build
|
||||
todo = user.todos.build
|
||||
todo.description = description
|
||||
todo.raw_notes = notes
|
||||
todo.context_id = context_id
|
||||
todo.project_id = project_id unless project_id.nil?
|
||||
todo.raw_notes = notes
|
||||
todo.context_id = context_id
|
||||
todo.project_id = project_id unless project_id.nil?
|
||||
todo.show_from = show_from if show_from.is_a? Date
|
||||
todo.due = due if due.is_a? Date
|
||||
todo.tag_with tags unless tags.nil? || tags.empty?
|
||||
todo.starred = star
|
||||
todo
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue