FIX: Saving a field as not required was actually making it required

until you edited it.
This commit is contained in:
Robin Ward 2014-10-14 17:21:34 -04:00
parent dd16ff81be
commit 2322586131
1 changed files with 1 additions and 0 deletions

View File

@ -6,6 +6,7 @@ class Admin::UserFieldsController < Admin::AdminController
def create
field = UserField.new(params.require(:user_field).permit(*Admin::UserFieldsController.columns))
field.required = params[:required] == "true"
json_result(field, serializer: UserFieldSerializer) do
field.save
end