|
@@ -1,10 +1,4 @@
|
|
|
class AdminUser < ActiveRecord::Base
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- devise :database_authenticatable,
|
|
|
- :recoverable, :rememberable, :trackable, :validatable
|
|
|
-
|
|
|
|
|
|
attr_accessible :email, :password, :password_confirmation, :remember_me
|
|
|
|
|
@@ -13,9 +7,9 @@ class AdminUser < ActiveRecord::Base
|
|
|
devise :database_authenticatable,
|
|
|
:recoverable, :rememberable, :trackable, :validatable
|
|
|
|
|
|
-
|
|
|
- attr_accessible :email, :password, :password_confirmation, :remember_me
|
|
|
-
|
|
|
+ validates :email,
|
|
|
+ :presence => true,
|
|
|
+ :format => { :with => /\A[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]+\z/, :message => "Must be of E-Mail address format" }
|
|
|
|
|
|
|
|
|
after_create { |admin| admin.send_reset_password_instructions }
|
|
@@ -23,4 +17,5 @@ class AdminUser < ActiveRecord::Base
|
|
|
def password_required?
|
|
|
new_record? ? false : super
|
|
|
end
|
|
|
+
|
|
|
end
|