add mail+pass change option

This commit is contained in:
jomo
2014-05-03 02:40:15 +02:00
parent b5b9a9316f
commit e79afbf990
9 changed files with 150 additions and 11 deletions

View File

@@ -10,10 +10,10 @@ class User < ActiveRecord::Base
before_validation :strip_whitespaces, :set_uuid, :set_name, :set_email_token, :set_role
validates_presence_of :password, :password_confirmation, :email_token, :on => :create
validates_presence_of :password, :password_confirmation, :email_token, on: :create
validates_presence_of :name, :email, :ign
validates_length_of :password, in: 8..256, :on => :create
validates_length_of :password, in: 8..256, on: [:create, :update], allow_nil: true
validates_length_of :name, in: 2..30
validates_length_of :about, maximum: 5000
validates_length_of :ign, minimum: 1, maximum: 16