summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Beauchamp <daniel.beauchamp@shopify.com>2013-01-24 17:14:26 -0500
committerDaniel Beauchamp <daniel.beauchamp@shopify.com>2013-01-24 17:14:26 -0500
commit17ef11ebf1ba22c63cfee4b668f314d69d9bd684 (patch)
treeaff16e913be0ae241f43c3fceae45db121e48b07 /lib
parentcdc1a5fcf994bee8d05bc48b2959b475448bfa12 (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/dashing.rb4
1 files changed, 2 insertions, 2 deletions
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 }