Sha256: feaae9d904efc0aa859a61baffd0ba8d22ad5771aff01eca1aec061a8538ac9b

Contents?: true

Size: 1.87 KB

Versions: 12

Compression:

Stored size: 1.87 KB

Contents

class User
  include Mongoid::Document
  include Mongoid::Timestamps
  include Sunrise::Models::User
  include Uploader::Fileuploads
  include PublicActivity::Model
  
  # Columns
  field :name, :type => String, :default => ""
      
  field :email, :type => String, :default => ""
  field :encrypted_password, :type => String, :default => ""
  
  field :reset_password_token, :type => String
  field :reset_password_sent_at, :type => DateTime
  
  field :remember_created_at, :type => DateTime
      
  field :sign_in_count, :type => Integer, :default => 0
  field :current_sign_in_at, :type => DateTime
  field :last_sign_in_at, :type => DateTime
  field :current_sign_in_ip, :type => String
  field :last_sign_in_ip, :type => String

  field :confirmation_token, :type => String
  field :confirmed_at, :type => DateTime
  field :confirmation_sent_at, :type => DateTime
  # field :unconfirmed_email, :type => String # Only if using reconfirmable
  
  field :failed_attempts, :type => Integer, :default => 0 # Only if lock strategy is :failed_attempts
  field :unlock_token, :type => String # Only if unlock strategy is :email or :both
  field :locked_at, :type => DateTime
      
  field :password_salt, :type => String
  field :role_type_id, :type => Integer
      
  # Token authenticatable
  # field :authentication_token, :type => String

  # Invitable
  # field :invitation_token, :type => String

  index({:email => 1}, {:unique => true})
  index({:reset_password_token => 1}, {:unique => true})
  index({:confirmation_token => 1}, {:unique => true})
  index({:unlock_token => 1}, {:unique => true})
  index({:role_type_id => 1})

  # Include default devise modules.
  devise :database_authenticatable, :confirmable, :lockable, :timeoutable,
         :recoverable, :rememberable, :trackable, :validatable
  
  fileuploads :avatar

  tracked owner: ->(controller, model) { controller.try(:current_user) }
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sunrise-cms-1.0.6 lib/generators/sunrise/templates/models/mongoid/user.rb
sunrise-cms-1.0.5 lib/generators/sunrise/templates/models/mongoid/user.rb
sunrise-cms-1.0.4 lib/generators/sunrise/templates/models/mongoid/user.rb
sunrise-cms-1.0.3 lib/generators/sunrise/templates/models/mongoid/user.rb
sunrise-cms-1.0.2 lib/generators/sunrise/templates/models/mongoid/user.rb
sunrise-cms-1.0.1 lib/generators/sunrise/templates/models/mongoid/user.rb
sunrise-cms-1.0.0 lib/generators/sunrise/templates/models/mongoid/user.rb
sunrise-cms-1.0.0.rc3 lib/generators/sunrise/templates/models/mongoid/user.rb
sunrise-cms-1.0.0.rc2 lib/generators/sunrise/templates/models/mongoid/user.rb
sunrise-cms-1.0.0.rc1 lib/generators/sunrise/templates/models/mongoid/user.rb
sunrise-cms-0.7.0.rc2 lib/generators/sunrise/templates/models/mongoid/user.rb
sunrise-cms-0.7.0.rc1 lib/generators/sunrise/templates/models/mongoid/user.rb