Sha256: 4a9b08dabd74cd9cf0055f2ee01fd8776615d993b0b8678b64811a944e2ac95a
Contents?: true
Size: 896 Bytes
Versions: 61
Compression:
Stored size: 896 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" belongs_to :novo_papel, :class_name => "Papel", :foreign_key => "novo_papel_id" validates_presence_of :nome, :email has_many :contatos accepts_nested_attributes_for :contatos, :allow_destroy => true 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
61 entries across 61 versions & 1 rubygems