Sha256: 8e2fc31fc275f4d3927da2515fca35419c208a166a60acc009a50dbff8dfce67

Contents?: true

Size: 411 Bytes

Versions: 66

Compression:

Stored size: 411 Bytes

Contents

class Membership < ActiveRecord::Base
  belongs_to :user
  belongs_to :account
  has_many :permissions
  has_many :projects, :through => :permissions

  validates_presence_of :user_id
  validates_presence_of :account_id
  validates_uniqueness_of :user_id, :scope => :account_id

  def name
    user.name
  end

  def email
    user.email
  end

  def self.by_name
    joins(:user).order('users.name')
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
saucy-0.2.28.1 app/models/membership.rb
saucy-0.4.0 app/models/membership.rb
saucy-0.3.4 app/models/membership.rb
saucy-0.3.3 app/models/membership.rb
saucy-0.3.2 app/models/membership.rb
saucy-0.3.1 app/models/membership.rb
saucy-0.3.0 app/models/membership.rb
saucy-0.2.45 app/models/membership.rb
saucy-0.2.44 app/models/membership.rb
saucy-0.2.43 app/models/membership.rb
saucy-0.2.42 app/models/membership.rb
saucy-0.2.41 app/models/membership.rb
saucy-0.2.40 app/models/membership.rb
saucy-0.2.39 app/models/membership.rb
saucy-0.2.38 app/models/membership.rb
saucy-0.2.36 app/models/membership.rb
saucy-0.2.35 app/models/membership.rb
saucy-0.2.34 app/models/membership.rb
saucy-0.2.33 app/models/membership.rb
saucy-0.2.32 app/models/membership.rb