Created
February 19, 2018 14:45
-
-
Save Schwad/307741b4de3065d80f9d7108c29f70f1 to your computer and use it in GitHub Desktop.
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 Current < ActiveSupport::CurrentAttributes | |
attribute :account, :user | |
attribute :request_id, :user_agent, :ip_address | |
resets { Time.zone = nil } | |
def user=(user) | |
super | |
self.account = user.account | |
Time.zone = user.time_zone | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment