admin_user.rb 973 B

1234567891011121314151617181920212223242526
  1. class AdminUser < ActiveRecord::Base
  2. # Include default devise modules. Others available are:
  3. # :token_authenticatable, :confirmable,
  4. # :lockable, :timeoutable and :omniauthable
  5. devise :database_authenticatable,
  6. :recoverable, :rememberable, :trackable, :validatable
  7. # Setup accessible (or protected) attributes for your model
  8. attr_accessible :email, :password, :password_confirmation, :remember_me
  9. # Include default devise modules. Others available are:
  10. # :token_authenticatable, :confirmable,
  11. # :lockable, :timeoutable and :omniauthable
  12. devise :database_authenticatable,
  13. :recoverable, :rememberable, :trackable, :validatable
  14. # Setup accessible (or protected) attributes for your model
  15. attr_accessible :email, :password, :password_confirmation, :remember_me
  16. # attr_accessible :title, :body
  17. after_create { |admin| admin.send_reset_password_instructions }
  18. def password_required?
  19. new_record? ? false : super
  20. end
  21. end