docbrown/spec/queries
Julianna Tetreault af5a391429
Part 2: Shows Relevant Posts in Homepage Sidebar (#12942) [deploy]
* Adjust active_threads class method to display posts in homepage sidebar

* WIP: add specs around active_threads class method

* Uses newer AR query syntax in Article#active_threads

* WIP: Updates article_spec.rb to get tests passing

* WIP: Adjust test to return articles that dont fall into constraints

* Adjusts spec to update articles properly

* Adjust article.update_columns to match initial article columns

* Extracts .active_threads into a query object and removes class method
 - Removes class method from Article model
 - Removes class method tests from article_spec.rb
 - Adds Articles::ActiveThreadsQuery to app/queries/articles
 - Adds active_threads_query_spec.rb to spec/queries/articles
 - Replaces Article.active_threads with Articles::ActiveThreadsQuery
in _homepage_content.html.erb and _sidebar_activity.html.erb
 - General code clean up

* Rename number to count in Articles::ActiveThreadsQuery

* WIP new specs

* Update spec

* Repleaces let! with before block to appease rubocop

* Refactors Articles::ActiveThreadsQuery#call per PR review suggestion

* Calls Articles::ActiveThreadsQuery within articles_helper instead of view

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2021-03-25 08:03:55 -06:00
..
admin Add all new functionality for trusted (#10816) 2020-10-15 17:00:49 -04:00
articles Part 2: Shows Relevant Posts in Homepage Sidebar (#12942) [deploy] 2021-03-25 08:03:55 -06:00