merges master and fixes conflicts
This commit is contained in:
@@ -11,17 +11,23 @@ class AccountController < ApplicationController
|
||||
if @account.update(account_params)
|
||||
redirect_to account_path, notice: t("flash.actions.save_changes.notice")
|
||||
else
|
||||
@account.errors.messages.delete(:organization)
|
||||
render :show
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_account
|
||||
@account = current_user
|
||||
end
|
||||
|
||||
def account_params
|
||||
params.require(:account).permit(:first_name, :last_name, :phone_number, :nickname, :use_nickname, :email_on_debate_comment, :email_on_comment_reply)
|
||||
if @account.organization?
|
||||
params.require(:account).permit(:phone_number, :email_on_debate_comment, :email_on_comment_reply, organization_attributes: [:name])
|
||||
else
|
||||
params.require(:account).permit(:first_name, :last_name, :phone_number, :nickname, :use_nickname, :email_on_debate_comment, :email_on_comment_reply)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user