Skip to content

Instantly share code, notes, and snippets.

@richmolj
Last active December 18, 2015 19:19
Show Gist options
  • Save richmolj/5832596 to your computer and use it in GitHub Desktop.
Save richmolj/5832596 to your computer and use it in GitHub Desktop.
around_filter :set_time_zone
def set_time_zone
begin
old_time_zone = Time.zone
Time.zone = current_user.time_zone if logged_in?
yield
ensure
Time.zone = old_time_zone
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment