merges master and fixes conflicts

This commit is contained in:
kikito
2015-08-17 02:40:11 +02:00
220 changed files with 14524 additions and 17665 deletions

View File

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