Skip to content

Commit

Permalink
prevent exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
blairanderson committed Oct 17, 2015
1 parent c4c9fd7 commit 6af2d43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def set_item
end

def set_user_item
@item = current_user.items.find(params[:id])
@item = current_user.items.where(id: params[:id]).first
unless @item
redirect_to :back, notice: 'Unauthorized'
return
Expand Down

0 comments on commit 6af2d43

Please sign in to comment.