From 17ef11ebf1ba22c63cfee4b668f314d69d9bd684 Mon Sep 17 00:00:00 2001 From: Daniel Beauchamp Date: Thu, 24 Jan 2013 17:14:26 -0500 Subject: Allow overriding the 'updatedAt' field. This is useful if you want to show the freshness of the data instead of when the job was last run. --- lib/dashing.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/dashing.rb b/lib/dashing.rb index 37dc54d..04e4cee 100644 --- a/lib/dashing.rb +++ b/lib/dashing.rb @@ -80,8 +80,8 @@ def production? end def send_event(id, body) - body["id"] = id - body["updatedAt"] = Time.now.to_i + body[:id] = id + body[:updatedAt] ||= Time.now.to_i event = format_event(body.to_json) settings.history[id] = event settings.connections.each { |out| out << event } -- cgit v1.2.3