Skip to content

Commit

Permalink
properly handle not found errors. #287
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 12, 2015
1 parent ca4d0ba commit 4794643
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/api/v6/works_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ def load_work
key, value = id_hash.first
@work = Work.where(key => value).first
else
fail ActiveRecord::RecordNotFound
@work = nil
end
fail ActiveRecord::RecordNotFound unless @work.present?
end

private
Expand Down

0 comments on commit 4794643

Please sign in to comment.