Sha256: a9f266964cb7a20db25c854f2b0a12fe0a58714e193c9e9ccb7f100690fba80b
Contents?: true
Size: 565 Bytes
Versions: 18
Compression:
Stored size: 565 Bytes
Contents
module CurrentAttributes::Base extend ActiveSupport::Concern included do attribute :user, :team, :membership, :ability 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
18 entries across 18 versions & 1 rubygems