Initial commit
This commit is contained in:
16
app/models/current.rb
Normal file
16
app/models/current.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class Current < ActiveSupport::CurrentAttributes
|
||||
attribute :account, :user
|
||||
|
||||
resets { Time.zone = nil }
|
||||
|
||||
def user=(user)
|
||||
super
|
||||
# overwritten later by the active account from session
|
||||
self.account = user.primary_account
|
||||
Time.zone = user.time_zone
|
||||
end
|
||||
|
||||
def account=(account)
|
||||
super
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user