Skip to content

Commit

Permalink
Merge pull request #669 from PecanProject/fix_issue_668
Browse files Browse the repository at this point in the history
Fix citation controller's show method
  • Loading branch information
robkooper authored Aug 10, 2019
2 parents ad16618 + e55b2cb commit 038dafe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/citations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ def index
# GET /citations/1
# GET /citations/1.xml
def show
@citation = Citation.where(:id => params[:id]).includes(params[:include]).first
# find_by! throws an ActiveRecord::RecordNotFound exception if no citation
# with the given id exists so that we don't attempt to display a nil
# citation.
@citation = Citation.includes(params[:include]).find_by!(:id => params[:id])

respond_to do |format|
format.html # show.html.erb
Expand Down

0 comments on commit 038dafe

Please sign in to comment.