Sha256: be68e6ea8ddb402d159c463dbbf89572b043a6b0b23acfeb84d0583aaed5dd23
Contents?: true
Size: 575 Bytes
Versions: 194
Compression:
Stored size: 575 Bytes
Contents
module CurrentAttributes::Base extend ActiveSupport::Concern included do attribute :user, :team, :membership, :ability, :context resets do Time.zone = nil end end def user=(user) super if user Time.zone = user.time_zone self.ability = Ability.new(user) else Time.zone = nil self.ability = nil end update_membership end def team=(team) super update_membership end def update_membership self.membership = if user && team user.memberships.where(team: team) end end end
Version data entries
194 entries across 194 versions & 1 rubygems