Code style fixes

This commit is contained in:
Jyri-Petteri Paloposki 2020-10-10 02:27:42 +03:00
parent c6bbc67dab
commit d8acf60049
72 changed files with 458 additions and 594 deletions

View file

@ -72,5 +72,4 @@ class RichMessageExtractor
def fix_date_string yymmdd
"20#{yymmdd[0..1]}-#{yymmdd[2..3]}-#{yymmdd[4..5]} 00:00"
end
end

View file

@ -1,5 +1,4 @@
class TodoFromRichMessage
attr_reader :user, :default_context_id, :description, :notes
def initialize(user, default_context_id, description, notes)
@ -21,8 +20,9 @@ class TodoFromRichMessage
context_id = default_context_id
if context.present?
found_context = user.contexts.active.where("name like ?", "%#{context}%").first
found_context = user.contexts.where("name like ?", "%#{context}%").first if !found_context
# TODO: Should this use ILIKE on Postgres?
found_context = user.contexts.active.where("name LIKE ?", "%#{context}%").first
found_context = user.contexts.where("name LIKE ?", "%#{context}%").first if !found_context
context_id = found_context.id if found_context
end