correct broken test
This commit is contained in:
parent
e7a037709f
commit
0f4f593c89
|
@ -53,15 +53,15 @@ class CategoriesController < ApplicationController
|
||||||
return render_json_error(@category) unless @category.save
|
return render_json_error(@category) unless @category.save
|
||||||
|
|
||||||
@category.move_to(category_params[:position].to_i) if category_params[:position]
|
@category.move_to(category_params[:position].to_i) if category_params[:position]
|
||||||
|
|
||||||
render_serialized(@category, CategorySerializer)
|
render_serialized(@category, CategorySerializer)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
guardian.ensure_can_edit!(@category)
|
guardian.ensure_can_edit!(@category)
|
||||||
json_result(@category, serializer: CategorySerializer) { |cat|
|
json_result(@category, serializer: CategorySerializer) { |cat|
|
||||||
cat.update_attributes(category_params)
|
|
||||||
cat.move_to(category_params[:position].to_i) if category_params[:position]
|
cat.move_to(category_params[:position].to_i) if category_params[:position]
|
||||||
|
category_params.delete(:position)
|
||||||
|
cat.update_attributes(category_params)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue