From 1614e876d264b5378d01f5ec8ec1a5a11de08675 Mon Sep 17 00:00:00 2001 From: echarp Date: Thu, 2 Nov 2017 21:41:18 +0100 Subject: [PATCH 1/2] Patch output is cleaner, again :) --- lib/differ/format/patch.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/differ/format/patch.rb b/lib/differ/format/patch.rb index 2cd8e980..2aaf5e97 100644 --- a/lib/differ/format/patch.rb +++ b/lib/differ/format/patch.rb @@ -19,13 +19,21 @@ module Differ private def as_insert(change) - change.insert[0] = '+' - change.insert + if change.insert.start_with? ' ' + change.insert[0] = '+' + change.insert + else + '+ ' + change.insert + end end def as_delete(change) - change.delete[0] = '-' - change.delete + if change.delete.start_with? ' ' + change.delete[0] = '-' + change.delete + else + '- ' + change.delete + end end def as_change(change) From 5efd394ce8aaa97e62e22e54824eb1703f75b7c7 Mon Sep 17 00:00:00 2001 From: echarp Date: Sun, 12 Nov 2017 19:12:48 +0100 Subject: [PATCH 2/2] Quick correction, so that nil repeatitions will not generate an exception --- app/models/event_callbacks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/event_callbacks.rb b/app/models/event_callbacks.rb index 832c377b..0a49a067 100644 --- a/app/models/event_callbacks.rb +++ b/app/models/event_callbacks.rb @@ -16,7 +16,7 @@ class EventCallbacks def self.before_update(event) return unless event.moderated_changed? && event.moderated? event.decision_time = Time.zone.now - create_repeats event if event.repeat > 0 && event.rule + create_repeats event if event.repeat.try(:positive?) && event.rule end def self.after_update(event)