From 2c179df88f5a3cabdcd34c9b3204ed35caa08044 Mon Sep 17 00:00:00 2001 From: Tim van der Staaij Date: Sun, 1 May 2016 11:25:10 +0200 Subject: [PATCH] Cast latest message id to string (#19) --- dumpers/lib/dumper_interface.rb | 2 +- lib/dump_progress.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dumpers/lib/dumper_interface.rb b/dumpers/lib/dumper_interface.rb index 0e5f9f5..2714da9 100644 --- a/dumpers/lib/dumper_interface.rb +++ b/dumpers/lib/dumper_interface.rb @@ -36,7 +36,7 @@ def msg_fresh?(msg, progress) if msg['date'] && msg['date'] > progress.newest_date return true elsif msg['date'] == progress.newest_date && progress.newest_id - return true if msg['id'] && msg['id'] > progress.newest_id + return true if msg['id'] && msg['id'].to_s > progress.newest_id.to_s end false diff --git a/lib/dump_progress.rb b/lib/dump_progress.rb index b3e9340..d048655 100644 --- a/lib/dump_progress.rb +++ b/lib/dump_progress.rb @@ -36,7 +36,7 @@ def to_json(*a) def update(msg) if !@newest_date || (msg['date'] && msg['date'] >= @newest_date) @newest_date = msg['date'] || @newest_date - @newest_id = msg['id'] || @newest_id + @newest_id = (msg['id'] || @newest_id).to_s end end