Commit graph

16 commits

Author SHA1 Message Date
Anna Buianova
784afdf41e
Routine rubocop fixes (#19254)
* Rubocop fixes

* Rubocop fixes

* Fixed rubocop violation

* Fixed policies rubocop violations

* More rubocop fixes
2023-03-24 14:37:44 +03:00
Jeremy Friesen
d7784fa8a1
Removing before_action in favor of explicity call (#16777)
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.

Closes forem/forem#16729

Reverses forem/forem#3806
2022-03-04 11:08:53 -05:00
rhymes
f5d35c6506
Rubocop: Enable and fix Style/StringConcatenation (#9844) 2020-08-18 14:50:15 +02:00
Michael Kohl
a4dadfb728
Standardize ActiveRecord order clauses (#9395)
* Change simple order clauses

* Change nested order clauses
2020-07-20 10:00:51 -04:00
rhymes
f1ec04a0c9
Rubocop: move dot in multi-line calls to leading position (#9262) 2020-07-16 15:51:11 +02:00
rhymes
397ef313de Improve video controllers caching and retrieving (#5709) [deploy]
* 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
2020-01-27 15:51:12 -05:00
Feruz Oripov
ee498ad9ef Refactor VideosController (#3806) [ci skip] 2019-08-26 18:59:31 -04:00
Mac Siri
6d1638ed68 Unskip all skipped specs (#2941)
* Change all login_as to sign_in

* Unskip comment spec

* Create new specs

* Turn on Webdriver caching

* Set logger for Omniauth in test

* Update editor system spec

* Fix editor approval file

* Update video_controller

* Update TagAdjustmentUpdateService's spec

* Update users api spec

* Update stories_index_spec

* Remove redundant spec file

* Remove residual code

* Change ClassifiedListing spec

* Update NotificationsIndex spec
2019-05-25 11:04:38 -04:00
rhymes
5782ffd7e0 Use published scope for articles (#2374)
* 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
2019-04-11 13:18:26 -04:00
Ben Halpern
81c44b7bfa
Only set cache control header on videos index page (#2346) 2019-04-08 20:13:35 -04:00
Ben Halpern
42a5124fe4
Clean up videos page and add tests (#2315) 2019-04-05 16:05:50 -04:00
Jess Lee
175569fb97 "/videos" (#2291)
* set up video route

* add video index

* update styling

* fix mobile full width styling

* bust cache when new video is created

* add unlimited scrolling
2019-04-05 14:02:03 -04:00
Araslanov Evgeny
8095c8fc4d Added ArticleWithVideoCreationService (#344) 2018-08-15 17:19:54 -04:00
rhymes
e588fa7ece Code cleanups (#659)
* 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
2018-08-07 11:00:13 -04:00
Ben Halpern
c60268b76f
Add pundit policy for several controllers (#476)
* Add pundit policy for several controllers

* Adjust video spec

* Fix tag request specs

* Add proper twilio tokens request specs

* Remove puts statements
2018-06-21 18:26:35 -04:00
Ben Halpern
cd4d5e9fcb
Improve and finalize video upload (#303) 2018-05-10 11:57:39 -04:00