Commit graph

9 commits

Author SHA1 Message Date
yheuhtozr
c4778d832e
app/controllers & decorators i18n (#16126)
* app/controllers (& decorators) i18n etc

* tidy key names

* update keys

* delete ja.yml

* delete an involved ja.yml

* fix for PR review

* fix for spec

* delete ja.yml
2022-02-03 13:35:56 -05:00
Jeremy Friesen
c7902a3261
Favor destroy_by over where.first&.destroy (#15868)
* Favor `destroy_by` over `where.first&.destroy`

We can use [ActiveRecord::Relation.destroy_by][1] instead of the method
chain.

[1]:https://api.rubyonrails.org/classes/ActiveRecord/Relation.html#method-i-destroy_by

* Restoring custom behavior

Those constants are not ActiveRecord::Base objects, so don't implement
the method.
2021-12-22 23:55:52 -05:00
Alex
b02d43ca2d
Create DiscussionLocks (#13905)
* Create DiscussionLocks

* Fix specs

* Update nullify_blank_notes_and_reason

* Update before_validation call

* Updated DiscussionLockPolicy for clarity

* Move permitted_attributes to a constant

* Update route

* Apply suggestions from code review for frontend

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Add title tags

* Wrap unlock confirm in main element

* Wrap flash messages up in div

* Actually fix title tags

* Hide comment reply button when discussion is locked

* Add E2E tests

* Try to fix E2E tests

* Cypress...you work locally but not in CI...why!?

* PR feedback

* Update E2E tests

* More E2E updates 😭

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-06-10 11:04:33 -04:00
Alex
d109b6824e
Refactor cache purging (#12811)
* Refactor caching

* Bring back old bust class

* Refactor with PR feedback

* Remove useless return values
2021-03-02 10:09:05 -05:00
Alex
f70af66258
Update bust to EdgeCache::Bust (#12052)
* Update bust to EdgeCache::Bust

* Update specs

* Fix more specs

* Fix more specs :)
2020-12-29 09:53:15 +01:00
Michael Kohl
b57ced5466 CacheBuster refactoring (#4766)
* Turn CacheBuster into a module

This class used no internal state, so repeatedly creating short-lived objects seems wasteful.

* Consistently use string interpolation and parenthesis

* Destructure arrays into meaningful names, formatting

* Fix request spec for internal classified listings controller

Interestingly this works when asserting directly on the module, but not on a double.
Asserting directly in the module seems sufficient for this test so the indirection
was removed.

* Turn CacheBuster into a module

This class used no internal state, so repeatedly creating short-lived objects seems wasteful.

* Fix specs after rebasing
2019-11-13 10:51:23 -05:00
Ben Halpern
47eaa9ece1
Adjust listings social image and add "About Listings" button to show page. (#3468)
* Adjust size and contrast for listings social preview

* Add about listings button and modify listings css
2019-07-12 16:40:39 -04:00
Ben Halpern
87002e5786
Fix profile pin display limit (#3427) 2019-07-09 15:42:46 -04:00
Ben Halpern
dcbb188cf1
Add pinned articles box to profiles (#3269)
* Initial pins work

* Add pin box to profiles

* Fix test snapshot spacing and optimize svg

* Fix listings spacing
2019-06-24 15:18:29 -04:00