Created
September 21, 2016 19:38
-
-
Save wbotelhos/9b6f5609a8d2a6623693bbbbec76789d to your computer and use it in GitHub Desktop.
Setting TimeZone per current_user
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
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