Sha256: 6e75f52d11a49707bf807bb45839661b7e60627146ce2b720fe2950376805613
Contents?: true
Size: 485 Bytes
Versions: 49
Compression:
Stored size: 485 Bytes
Contents
class Membership < ActiveRecord::Base belongs_to :user belongs_to :account has_many :permissions, :dependent => :destroy has_many :projects, :through => :permissions validates_presence_of :user_id validates_presence_of :account_id validates_uniqueness_of :user_id, :scope => :account_id def self.admin where(:admin => true) end def name user.name end def email user.email end def self.by_name joins(:user).order('users.name') end end
Version data entries
49 entries across 49 versions & 2 rubygems