Sha256: 222325b9590616527dde155e7f384474090da20c62f7d2ab38c335e76cbe3544

Contents?: true

Size: 643 Bytes

Versions: 9

Compression:

Stored size: 643 Bytes

Contents

class Usuario < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  belongs_to :papel
  validates_presence_of :nome, :email

  def to_s
    nome
  end

  def self.params_permitt
    [:password, :password_confirmation]
  end

  def ability
    @ability ||= Ability.new(self)
  end
  
  def self.current
    return Thread.current[:current_usuario]
  end
  
  def self.current=(usuario)
    Thread.current[:current_usuario] = usuario
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
templus_models-1.3.0 test/dummy/app/models/usuario.rb
templus_models-1.2.8 test/dummy/app/models/usuario.rb
templus_models-1.2.7 test/dummy/app/models/usuario.rb
templus_models-1.2.6 test/dummy/app/models/usuario.rb
templus_models-1.2.5 test/dummy/app/models/usuario.rb
templus_models-1.2.4 test/dummy/app/models/usuario.rb
templus_models-1.2.3 test/dummy/app/models/usuario.rb
templus_models-1.2.2 test/dummy/app/models/usuario.rb
templus_models-1.2.1 test/dummy/app/models/usuario.rb