Skip to content
Snippets Groups Projects
Commit 6f29bc8d authored by Adam Cooke's avatar Adam Cooke
Browse files

ensure all timestamps from the message DB go through a zone

parent 6e009f16
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -22,5 +22,5 @@
%p.suppressionList__address= link_to suppression['address'], outgoing_organization_server_messages_path(organization, @server, :query => "to: #{suppression['address']}")
%p.suppressionList__reason= suppression['reason'].capitalize
.suppressionList__right
%p.suppressionList__timestamp Added #{Time.at(suppression['timestamp']).to_s(:long)}
%p.suppressionList__timestamp Added #{Time.zone.at(suppression['timestamp']).to_s(:long)}
= render 'shared/message_db_pagination', :data => @suppressions, :name => "suppression"
Loading
Loading
@@ -6,7 +6,7 @@ module Postal
@url = link['url']
@ip_address = attributes['ip_address']
@user_agent = attributes['user_agent']
@timestamp = Time.at(attributes['timestamp'])
@timestamp = Time.zone.at(attributes['timestamp'])
end
 
attr_reader :ip_address
Loading
Loading
Loading
Loading
@@ -26,7 +26,7 @@ module Postal
end
 
def timestamp
@timestamp ||= @attributes['timestamp'] ? Time.at(@attributes['timestamp']) : nil
@timestamp ||= @attributes['timestamp'] ? Time.zone.at(@attributes['timestamp']) : nil
end
 
def update_statistics
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ module Postal
def initialize(attributes)
@ip_address = attributes['ip_address']
@user_agent = attributes['user_agent']
@timestamp = Time.at(attributes['timestamp'])
@timestamp = Time.zone.at(attributes['timestamp'])
end
 
attr_reader :ip_address
Loading
Loading
Loading
Loading
@@ -97,21 +97,21 @@ module Postal
# Return the timestamp for this message
#
def timestamp
@timestamp ||= @attributes['timestamp'] ? Time.at(@attributes['timestamp']) : nil
@timestamp ||= @attributes['timestamp'] ? Time.zone.at(@attributes['timestamp']) : nil
end
 
#
# Return the time that the last delivery was attempted
#
def last_delivery_attempt
@last_delivery_attempt ||= @attributes['last_delivery_attempt'] ? Time.at(@attributes['last_delivery_attempt']) : nil
@last_delivery_attempt ||= @attributes['last_delivery_attempt'] ? Time.zone.at(@attributes['last_delivery_attempt']) : nil
end
 
#
# Return the hold expiry for this message
#
def hold_expiry
@hold_expiry ||= @attributes['hold_expiry'] ? Time.at(@attributes['hold_expiry']) : nil
@hold_expiry ||= @attributes['hold_expiry'] ? Time.zone.at(@attributes['hold_expiry']) : nil
end
 
#
Loading
Loading
Loading
Loading
@@ -45,7 +45,7 @@ module Postal
end
end
@database.select("stats_#{type}", :where => {:time => items.keys.map(&:to_i)}, :fields => [:time] | counters).each do |data|
time = Time.at(data.delete('time'))
time = Time.zone.at(data.delete('time'))
data.each do |key, value|
items[time][key.to_sym] = value
end
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@ module Postal
end
 
def timestamp
Time.at(@attributes['timestamp'])
Time.zone.at(@attributes['timestamp'])
end
 
def event
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment