Skip to content

Instantly share code, notes, and snippets.

@wbotelhos
Created September 21, 2016 19:38
Show Gist options
  • Save wbotelhos/9b6f5609a8d2a6623693bbbbec76789d to your computer and use it in GitHub Desktop.
Save wbotelhos/9b6f5609a8d2a6623693bbbbec76789d to your computer and use it in GitHub Desktop.
Setting TimeZone per current_user
around_action :user_time_zone, if: :current_user
def user_time_zone(&block)
Time.use_zone(current_user.time_zone, &block)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment