Sha256: d2316cbe54338ab0d9dd8bf6c82a71d3d3e5d429ea5d0243705b18be76a5b6b8

Contents?: true

Size: 563 Bytes

Versions: 2

Compression:

Stored size: 563 Bytes

Contents

module Cadenero
  # Defines a user of one or more accounts for the multitenant Rails App
  class User < ActiveRecord::Base
    attr_accessible :email, :password, :password_confirmation
    has_secure_password
    has_many :accounts, class_name: "Cadenero::V1::Account", foreign_key: "owner_id"
    has_many :members, class_name: "Cadenero::Member"
    has_many :memberships, through: :members, source: :account

    # Map the auth_tokens for each account that the User is memeber
    def auth_token
      members.map{|member| member.auth_token}
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cadenero-0.0.2.b8 app/models/cadenero/user.rb
cadenero-0.0.2.b7 app/models/cadenero/user.rb