add strip_attributes
converts empty string to nil on the user model so unique indexes with null: true will not break
This commit is contained in:
@@ -2,10 +2,10 @@ class User < ActiveRecord::Base
|
||||
include UsersHelper
|
||||
include ActionView::Helpers
|
||||
include Rails.application.routes.url_helpers
|
||||
strip_attributes
|
||||
|
||||
belongs_to :role
|
||||
|
||||
|
||||
has_secure_password
|
||||
|
||||
before_validation :strip_whitespaces, :set_uuid, :set_name, :set_email_token, :set_role
|
||||
|
||||
Reference in New Issue
Block a user