app/models/adminpanel/user.rb in adminpanel-2.2.2 vs app/models/adminpanel/user.rb in adminpanel-2.2.3
- old
+ new
@@ -10,16 +10,16 @@
#name validations
validates_presence_of :name
validates_length_of :name, :maximum => 25
#password validations
- validates_confirmation_of :password
- validates_presence_of :password
- validates_length_of :password, :minimum => 6
+ validates_confirmation_of :password, :on => :create
+ validates_presence_of :password, :on => :create
+ validates_length_of :password, :minimum => 6, :on => :create
#password_confirmation validations
- validates_presence_of :password_confirmation
+ validates_presence_of :password_confirmation, :on => :create
#email validations
validates_presence_of :email
validates_uniqueness_of :email
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
@@ -72,9 +72,13 @@
'placeholder' => I18n.t('model.attributes.rol_id'),
'label' => I18n.t('model.attributes.rol_id')
}
},
]
+ end
+
+ def root_url
+ self.rol.permissions.first
end
def self.display_name
'Usuario'
end