docbrown/app/services/search
Jeremy Friesen 9df5f6af49
Ensuring reading list excludes unpublished articles (#15490)
* Ensuring reading list excludes unpublished articles

Prior to this commit, if a given user adds an article to their reading
list then the author unpublishes the article, the article remains in the
reading list.  When the given user would then "click" on the now
unpublished article, they would get a 404 Not Found notice.

With this commit, we now exclude unpublished articles from the search
results for the reading list.

This should also address the issue of attempting to archive the reading
list item (because it won't be visible in the listing).

One of the behaviors that is expected is if, in the above scenario, the
author again publishes the article, that article will again "appear" on
the reading list for the given user.

Closes #14796

* Updating documentation and adding spec

* Addressing pull request feedback

Yes, I should've used a scope!  And also, no need to test present.  Just
let it's "truthy"-ness speak for itself!

* Update spec/services/search/reading_list_spec.rb

Co-authored-by: Jamie Gaskins <jamie@forem.com>

Co-authored-by: Jamie Gaskins <jamie@forem.com>
2021-11-24 13:22:26 -05:00
..
article.rb Search results: prioritize articles titles (#13918) 2021-06-09 14:28:19 +02:00
comment.rb Cleanup search classes and serializers (#13645) 2021-05-05 09:20:59 -04:00
listing.rb ✂✂✂ Remove Connect (#14734) 2021-11-18 08:21:00 -06:00
podcast_episode.rb Cleanup search classes and serializers (#13645) 2021-05-05 09:20:59 -04:00
reading_list.rb Ensuring reading list excludes unpublished articles (#15490) 2021-11-24 13:22:26 -05:00
tag.rb Suggest top tags when tag search is empty (#14817) 2021-09-30 09:41:20 +01:00
user.rb Bump rubocop from 1.18.1 to 1.18.3 (#14144) 2021-07-06 15:36:35 +02:00
username.rb Cleanup search classes and serializers (#13645) 2021-05-05 09:20:59 -04:00