app/models/pbw/user.rb in pbw-0.0.2 vs app/models/pbw/user.rb in pbw-0.0.3

- old
+ new

@@ -1,13 +1,12 @@ module Pbw class User include ::Mongoid::Document - # Include default devise modules. Others available are: - # :token_authenticatable, :confirmable, - # :lockable, :timeoutable and :omniauthable - devise :database_authenticatable, :registerable, - :recoverable, :rememberable, :trackable, :validatable + include ::Mongoid::Timestamps + + devise :database_authenticatable, :registerable, :timeoutable, :confirmable, + :recoverable, :rememberable, :trackable, :validatable, :lockable, :token_authenticatable ## Database authenticatable field :email, :type => String, :default => "" field :encrypted_password, :type => String, :default => "" @@ -44,9 +43,12 @@ field :unlock_token, :type => String # Only if unlock strategy is :email or :both field :locked_at, :type => Time ## Token authenticatable field :authentication_token, :type => String + + has_many :resource_containers + has_many :user_tokens def super_admin? self.role.name == "Super Admin" end end