Skip to content

Commit

Permalink
bug fix, i need to not dup the logic three times!
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Dec 7, 2023
1 parent 9f88b89 commit 6545c56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/books/refresh_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def update
next unless count_of_judgements.positive?

rating = Rating.find_or_initialize_by(query: query, doc_id: query_doc_pair.doc_id)

rating.user = query_doc_pair.judgements.last.user if rating.user.nil?
rating.rating = if @book.support_implicit_judgements?
summed_rating / count_of_judgements
else
Expand Down

0 comments on commit 6545c56

Please sign in to comment.