Sha256: 8233709ff04d6cb487309aeefca5d7d98c8ff25e6c864b5b05e0d908839ee828

Contents?: true

Size: 668 Bytes

Versions: 4

Compression:

Stored size: 668 Bytes

Contents

# encoding: utf-8
require 'bcrypt'
module Fastui
  class MPerson < MObject
    attr_accessible :username, :password, :access_level
    has_many :m_relationships, :foreign_key => 'm_person_id', :class_name => 'Fastui::MRelationship'
    has_many :act_roles, :through => :m_relationships, :source => :m_role
    has_many :join_orgs, :through => :m_relationships, :source => :m_org

    # users.password_digest in the database is a :string
    include BCrypt

    def password
      @password ||= Password.new(self.password_digest)
    end

    def password=(new_password)
      self.password_digest = Password.create(new_password)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fastui-0.1.6 app/models/fastui/m_person.rb
fastui-0.1.4 app/models/fastui/m_person.rb
fastui-0.1.3 app/models/fastui/m_person.rb
fastui-0.1.2 app/models/fastui/m_person.rb