Sha256: e4cb82ee5b6838764f857cccedf88c52e698708deaf91bd391a6467d12cd5643

Contents?: true

Size: 588 Bytes

Versions: 1

Compression:

Stored size: 588 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

    # Obtain the authentication_token from the account to be use for the User
    def auth_token      
      accounts.map{|acc| acc.authentication_token}
    end
  
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cadenero-0.0.2.b4 app/models/cadenero/user.rb