Sha256: 26ed25a35887aad6a56d4cd25c45a256b7e083fbc0d1ff726066e5a1a513febd
Contents?: true
Size: 415 Bytes
Versions: 44
Compression:
Stored size: 415 Bytes
Contents
class Permission < ActiveRecord::Base belongs_to :membership belongs_to :project belongs_to :user before_validation :assign_user_id_from_membership validates_uniqueness_of :membership_id, :scope => :project_id def user=(ignored) raise NotImplementedError, "Use Permission#membership= instead" end private def assign_user_id_from_membership self.user_id = membership.user_id end end
Version data entries
44 entries across 44 versions & 2 rubygems