Created
July 11, 2012 13:28
-
-
Save ayosec/3090382 to your computer and use it in GitHub Desktop.
Force UTC times
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hash | |
def times_with_utc | |
dup.tap do |new_hash| | |
each_key do |key| | |
value = self[key] | |
if value.is_a?(ActiveSupport::TimeWithZone) | |
new_hash[key] = value.utc | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment