lib/mixpanel/tracker.rb in mixpanel-4.0.5 vs lib/mixpanel/tracker.rb in mixpanel-4.0.6
- old
+ new
@@ -41,13 +41,15 @@
def ip
(@env['HTTP_X_FORWARDED_FOR'] || @env['REMOTE_ADDR'] || '').split(',').last
end
- # Walk through each property and see if it is in the special_properties. If so, change the key to have a $ in front of it.
+ # Walk through each property and see if it is in the special_properties.
+ # If so, change the key to have a $ in front of it.
def properties_hash(properties, special_properties)
properties.inject({}) do |props, (key, value)|
key = "$#{key}" if special_properties.include?(key.to_s)
+ value = value.to_i if value.class == Time
props[key.to_sym] = value
props
end
end