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:
jomo
2015-08-26 02:54:51 +02:00
parent 20d31494dc
commit 9edbdb7d55
4 changed files with 6 additions and 2 deletions

View File

@@ -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