While in essence an idempotent change the purpose of this PR is to also
favor explicit method calls over callbacks. Note, we don't have an
associated model (e.g. Video) and instead rely on `:video` which Pundit
converts to VideoPolicy.
From my experience in rails it can become challenging to mentally parse
the various before/after action paired with the only and except. As
well as considering the timing of what happens when.
Further this commit helps provide a record of "work" towards an issue.
Closesforem/forem#16729
Reverses forem/forem#3806
* Add tests and improve pagination and caching
* Add two more specs
* Add .with_video scope
* Get rid of N+1
* Only select needed columns
* Improve efficiency of the video page as well
* Add missing set_cache_control_headers to API videos#index
* Use published scope for articles
* Fix variable name
* The sequencing in the union query matters
* Fix spec
* Restore a published: true condition
* This test is actually misleading due to the union
* Revert this change, not sure why it's not a relation
* Fix useless diff
* set up video route
* add video index
* update styling
* fix mobile full width styling
* bust cache when new video is created
* add unlimited scrolling
* Initial automatic cleanup with rubocop
* Fix syntax error introduced by rubocop
* Cleanup seeds file
* Cleanup lib folder
* Exclude bin folder because it contains auto generated files
* Make Rubocop a little bit more chatty
* Block length should not include comments in the count
* Cleanup config folder
* Cleanup specs
* Updated Rubocop version and generated a todo file
* Fix broken ArticlesApi spec
* Fix tests
* Restored rubocop pre-commit hook