Skip to content

Instantly share code, notes, and snippets.

View BMorearty's full-sized avatar
🐮
moo

Brian Morearty BMorearty

🐮
moo
View GitHub Profile
@BMorearty
BMorearty / gist:809775
Created February 3, 2011 16:59
How to reset the timezone after handling a request.
around_filter :set_time_zone
def set_time_zone
old_time_zone = Time.zone
Time.zone = current_user.time_zone if logged_in?
yield
ensure
Time.zone = old_time_zone
end