* Enable new Rails/* cops and use autocorrect on them
* Fixed Rails/PluckInWhere leftovers
* Fix Rails/DefaultScope
* Enable and fix Rails/PluckId
* Fix manual mistake with forcing autocorrection on Rails/PluckId
* Apply PR feedback to remove Rails/PluckId inline disables
* Apply PR feedback to get rid of Rails/PluckInWhere inline
* Make liquid tags adhere to context and permission
* Undo updates to all liquid tags and update error
* ACTUALLY update errors this time
* Typo
* Refactor error handling and add support for Comment
* Fix specs
* Code cleanup
* Prettify error message
* Add comment clarifying error
* parsed --> parse
* Use a policy for validating roles
* Fix pretty error message
* Return early if valid source
* Get rid of duplicate current_user
* Add comment to Pundit.authorize
* LiquidTagPolicy specs
* Update liquid tag docs
* Update docs
* Use parse_context argument for clarity
* Remove duplicate guard clause for VALID_ROLES
* Update docs
* Modernize index test
* Hide comments body_html and user info if the comment is either deleted or hidden
* Shorten lines a bit
* Freeze repeated strings
* Document all /comments
* Document /comments/{id}
* Remove Algolia from comments
* Remove more references to ordered_comments index
* Remove more references to Comments Algolia index
* Fix index_worker_spec
* Initial field test spec work
* Clean up specs
* Fix codeclimage
* Cleanups
* Update names
* Rename and remove need to pass logged in status
* Leadup to prod: two experiments
* Move test logic to controller and add tests
Co-authored-by: Josh Puetz <josh@grorichpuetz.com>
* Create RemoveFromIndexWorker
* Create spec for RemoveFromIndexWorker
* Update RemoveFromIndexJob to RemoveFromIndexWorker
- Update references from the job to the new worker
- Update specs to use the new worker
- Fix spec in comment_spec that causes linter/RuboCop violation
* Remove unnecessary argument nil check
* Update spec for missing data
* Add sidekiq version of the corresponding delayed job
* Switch the invocation of the delayed job from `after_create` to
`after_create_commit` to avoid the race condition where the worker can
be executed before the comment is persisted. Added covering spec
for this change.
* 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
* Clarify uncommunicative variables in labor classes
Single letter variable names are largely a question of preference, in
some cases I think that convention mitigates the opaque nature of single
letter variable names (e.g., e for error, i for index, etc).
However, in some cases they can be unclear and there isn't much reason
to use single letter variables unless for some reason character length is
really important.
In this case, I would prefer clarity in variable names over brevity of
code so I've used Reek to identify short variable names and I'm changing
them.
It's pretty boring, but hopefully incremental code love changes like
this one add up and improve readability and accessibility for those
interested in reading this codebase.
* Remove commented code from 2 years ago
* Clarify uncommunicative naming in services classes
There is some context for this change in 6b81880f
* Clarify uncommunicative naming in models
There is some context for this change in 6b81880f
* Clarify uncommunicative naming in liquid_tags
There is some context for this change in 6b81880f