intercom/intercom-rails — pull request #34 by jgwhite (2013-04-03 13:11:49+00:00)
Title: Update timestamp generation to support ActiveSupport::TimeWithZone

We found that the current method for generating unix timestamps in `ScriptTag` can produce the wrong timestamp for `ActiveSupport::TimeWithZone` objects.

It seems that `TimeWithZone#strftime('%s')` will yield a timestamp that includes daylight savings offsets. The resulting timestamp will be an hour adrift if daylight savings are in effect.

This PR switches to using `to_i` directly on `Time`, `DateTime` and their descendants.