forked from External/greenlight
fix gl accounts unable to update settings
This commit is contained in:
parent
8089decc17
commit
a6b05f5fd3
|
@ -58,7 +58,7 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
if errors.empty? && @user.save
|
if errors.empty? && @user.save
|
||||||
# Notify the use that their account has been updated.
|
# Notify the user that their account has been updated.
|
||||||
redirect_to edit_user_path(@user), notice: "Information successfully updated."
|
redirect_to edit_user_path(@user), notice: "Information successfully updated."
|
||||||
else
|
else
|
||||||
# Append custom errors.
|
# Append custom errors.
|
||||||
|
|
|
@ -14,7 +14,7 @@ class User < ApplicationRecord
|
||||||
uniqueness: { case_sensitive: false },
|
uniqueness: { case_sensitive: false },
|
||||||
format: { with: /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i }
|
format: { with: /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i }
|
||||||
|
|
||||||
validates :password, length: { minimum: 6 }, confirmation: true, if: :greenlight_account?
|
validates :password, length: { minimum: 6 }, confirmation: true, if: :greenlight_account?, on: :create
|
||||||
|
|
||||||
# We don't want to require password validations on all accounts.
|
# We don't want to require password validations on all accounts.
|
||||||
has_secure_password(validations: false)
|
has_secure_password(validations: false)
|
||||||
|
|
Loading…
Reference in New Issue