Skip to content

Commit

Permalink
Add a guard against accidental moves
Browse files Browse the repository at this point in the history
  • Loading branch information
sachac committed May 29, 2015
1 parent 08dcc2a commit a79e095
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/receipt_item_types_controller.rb
Expand Up @@ -107,7 +107,7 @@ def get_autocomplete_items(parameters)
def move_to
old_type = current_account.receipt_item_types.find(params[:id])
new_type = current_account.receipt_item_types.find(params[:new_id])
if old_type && new_type
if old_type && new_type && old_type.id != new_type.id
old_type.move_to(new_type)
respond_with(new_type)
else
Expand Down

0 comments on commit a79e095

Please sign in to comment.