docbrown/app/controllers/api/v0
Jeremy Friesen faaf2ec028
Favoring explicit declaration over inferrence (#17089)
This commit does three things:

1. Documents a method
3. Implies the question: "Do we want to use class_attribute in Forem's codebase?"
2. Switches from an inferrence to an explicit (and configurable)

In my experience, I want to favor "explicit" declarations instead of
inferring what they should be.  In this case, the inferrence is perhaps
adequate.  But as I look to `ApplicationController::PUBLIC_CONTROLLERS`,
I think that is a prime case for a `class_attribute`.  (The `api_action`
happened to be the lowest hanging fruit to begin the conversation.)

We still need some clarity into the `verify_private_forem` method as it
looks like it's doing a few different things.

There is precedence for using `class_attribute` found in
[`UniqueCrossModelSlugValidator.model_and_attribute_name_for_uniqueness_test`][1] (also
introduced by me).

[1]:https://github.com/forem/forem/blob/main/app/validators/unique_cross_model_slug_validator.rb
2022-04-06 10:42:08 -04:00
..
admin Admin API use case 1: endpoint to create users (#16520) 2022-02-15 09:30:00 +07:00
analytics_controller.rb Ensuring the same policies for analytics (#16997) 2022-03-25 14:57:01 -04:00
api_controller.rb Favoring explicit declaration over inferrence (#17089) 2022-04-06 10:42:08 -04:00
articles_controller.rb Ensuring POST api/v0/articles authorizes by policy (#16685) 2022-02-28 08:50:33 -05:00
comments_controller.rb Profile generalization cleanup phase 2 (#14555) 2021-08-27 09:17:26 +07:00
feature_flags_controller.rb Easier feature flag handling for Cypress (#16379) 2022-02-03 10:42:13 -05:00
followers_controller.rb 15 minute fix: Add default argument to JsonApiSortParam (#13369) 2021-04-14 10:32:07 +07:00
follows_controller.rb app/controllers/api i18n (#16002) 2022-01-11 10:05:54 +07:00
health_checks_controller.rb app/controllers/api i18n (#16002) 2022-01-11 10:05:54 +07:00
instances_controller.rb Remove counts from instance API (#16479) 2022-02-09 11:07:44 -05:00
listings_controller.rb Prefer "listing" to "classified_listing" in the api (#17021) 2022-03-28 13:40:00 -05:00
organizations_controller.rb Profile generalization: cleanup (#12947) 2021-08-20 16:36:02 +02:00
podcast_episodes_controller.rb
profile_images_controller.rb
readinglist_controller.rb Remove Doorkeeper from API (#15750) 2021-12-16 09:57:26 -06:00
tags_controller.rb Add ability to bulk search tags by name or id (#16671) 2022-02-24 12:34:50 -05:00
users_controller.rb Remove Doorkeeper from API (#15750) 2021-12-16 09:57:26 -06:00
videos_controller.rb Return video_source_url in API V0 Videos index (#11040) 2020-11-09 06:27:28 +01:00