Skip to content

Commit

Permalink
Change food_type ivar in #destroy to local variable"
Browse files Browse the repository at this point in the history
  • Loading branch information
vidoseaver authored and rylanb committed Mar 25, 2017
1 parent 21eff4e commit 68d738a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/food_types_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ def index
end

def destroy
@food_type = FoodType.find(params[:id])
authorize! :destroy, @food_type
@food_type.active = false
@food_type.save
food_type = FoodType.find(params[:id])
authorize! :destroy, food_type
food_type.active = false
food_type.save
redirect_to(request.referrer)
end

Expand Down

0 comments on commit 68d738a

Please sign in to comment.