FIX: Saving a user field as required didn't work the first time

This commit is contained in:
Robin Ward 2016-03-09 15:34:48 -05:00
parent 360a794335
commit 5fcd5002c4

View file

@ -8,7 +8,7 @@ class Admin::UserFieldsController < Admin::AdminController
field = UserField.new(params.require(:user_field).permit(*Admin::UserFieldsController.columns))
field.position = (UserField.maximum(:position) || 0) + 1
field.required = params[:required] == "true"
field.required = params[:user_field][:required] == "true"
update_options(field)
json_result(field, serializer: UserFieldSerializer) do