bugfix
This commit is contained in:
@@ -379,9 +379,14 @@ select {
|
|||||||
input , select, textarea {
|
input , select, textarea {
|
||||||
margin: 4px;
|
margin: 4px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
||||||
&[type=submit] {
|
&[type=submit] {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
&.btn {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
option {
|
option {
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class User < ActiveRecord::Base
|
|||||||
|
|
||||||
has_secure_password
|
has_secure_password
|
||||||
|
|
||||||
before_validation :strip_whitespaces, :set_uuid, :set_name, :set_email_token
|
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_presence_of :name, :email, :ign
|
||||||
@@ -173,6 +173,10 @@ class User < ActiveRecord::Base
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def set_role
|
||||||
|
self.role ||= Role.get(:normal)
|
||||||
|
end
|
||||||
|
|
||||||
def set_uuid
|
def set_uuid
|
||||||
if !self.uuid.present?
|
if !self.uuid.present?
|
||||||
# idk
|
# idk
|
||||||
|
|||||||
Reference in New Issue
Block a user