Sha256: 7735a99aaa0e58c8f1e323ff68f3f047af773f0128a67c3db21de9151051b89b

Contents?: true

Size: 718 Bytes

Versions: 6

Compression:

Stored size: 718 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
  belongs_to :perfil, :class_name => "Papel", :foreign_key => "papel_id"
  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

6 entries across 6 versions & 1 rubygems

Version Path
templus_models-1.3.7 test/dummy/app/models/usuario.rb
templus_models-1.3.6 test/dummy/app/models/usuario.rb
templus_models-1.3.4 test/dummy/app/models/usuario.rb
templus_models-1.3.3 test/dummy/app/models/usuario.rb
templus_models-1.3.2 test/dummy/app/models/usuario.rb
templus_models-1.3.1 test/dummy/app/models/usuario.rb