User/Person models merge
This commit is contained in:
parent
66b84e3660
commit
23bf55b66c
80 changed files with 1064 additions and 1221 deletions
|
|
@ -36,15 +36,15 @@ class RegistrationsController < Devise::RegistrationsController
|
|||
|
||||
if successfully_updated
|
||||
if email_changed
|
||||
if !@user.person.nil?
|
||||
@user.person.update_attribute("email", params[:user][:email])
|
||||
if !@user.nil?
|
||||
@user.update_attribute('email', params[:user][:email])
|
||||
end
|
||||
set_flash_message :notice, :update_needs_confirmation
|
||||
else
|
||||
set_flash_message :notice, :updated
|
||||
end
|
||||
# Sign in the user bypassing validation in case his password changed
|
||||
sign_in @user, :bypass => true
|
||||
sign_in @user, bypass: true
|
||||
redirect_to after_update_path_for(@user)
|
||||
else
|
||||
flash[:alert] = 'Updating account failed. ' \
|
||||
|
|
@ -66,11 +66,11 @@ class RegistrationsController < Devise::RegistrationsController
|
|||
def configure_permitted_parameters
|
||||
devise_parameter_sanitizer.for(:account_update) do |u|
|
||||
u.
|
||||
permit(:email, :password, :password_confirmation, :current_password,
|
||||
person_attributes: [:id, :email, :first_name, :last_name,
|
||||
:public_name, :biography, :company, :avatar,
|
||||
:irc_nickname, :mobile, :tshirt, :languages,
|
||||
:volunteer_experience])
|
||||
permit(:email, :password, :password_confirmation, :current_password, :name, :biography)
|
||||
end
|
||||
devise_parameter_sanitizer.for(:sign_up) do |u|
|
||||
u.
|
||||
permit(:email, :password, :password_confirmation, :name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue