Commit graph

23 commits

Author SHA1 Message Date
Andy Allan
c1cccd40fc Move check_api_readable to api_controller
It's easier to skip the check in the two places that we need to, and
include it by default everywhere else.
2024-05-29 14:54:16 +01:00
Andy Allan
f2aaec4735 Standardise on avoiding except lists for check_api_readable
Although this is technically duplicative, it's much easier to read
and therefore to maintain, particularly if you put the _readable one
first.
2024-05-29 14:51:47 +01:00
Andy Allan
995bfa91ff Remove duplicate database status checks
These are already done as part of the api checks
2024-05-29 14:51:20 +01:00
Tom Hughes
33d292e981 Move scheduling of trace import and destruction to the model 2024-02-24 17:07:38 +00:00
Andy Allan
1700c23dd1 Prefer find_by() instead of where().first
These are very similar, differing only if we would expect multiple
results and the sorting is important. However, in all our cases
we're only expecting one result to be returned, and so find_by is
easier to read.
2023-10-04 17:53:58 +01:00
Anton Khorev
9c9edb6054 Remove authorize_web call from traces api controller 2023-09-09 19:40:28 +03:00
Andy Allan
22946d703a Enable the ActionOrder cop for remaining controllers
Where actions were reordered, the rails standard actions were
also moved to the top of each controller.
2022-11-02 11:06:00 +00:00
Tom Hughes
7f619c6484 Check API status before authorizing access
Fixes #3530
2022-04-11 20:47:52 +01:00
Tom Hughes
b5f06e06c1 Fix rubocop Rails/TimeZone warnings 2022-03-01 22:55:10 +00:00
Tom Hughes
0410596908 Switch traces to use ActiveStorage 2021-12-16 18:45:31 +00:00
Andy Allan
3aa8292d6d Drop the trace_use_job_queue option
This has been set as true by default, and in production, for many
years. I don't think there's much use in keeping the setting around
any longer.
2021-11-24 15:23:27 +00:00
Andy Allan
8c326a6c1f Remove unnecessary layout calls from api controllers
These were left over from the refactoring of the controllers into api and non-api versions.
2020-07-08 18:51:27 +02:00
Tom Hughes
96ee7ef95c Only report traces as offline when they are offline 2020-07-07 10:37:56 +01:00
Tom Hughes
2def62ee19 Fix errors with GPX offline mode 2020-07-05 14:49:12 +01:00
Andy Allan
c24b0e9399 Rework to ensure views are named after the controller method name 2019-06-26 13:45:40 +02:00
Frederik Ramm
17e6e69c39 Move generation of gpx_file XML from model to builder 2019-04-14 16:25:14 +01:00
Andy Allan
5444af981c Resourceful route names for api/trace_controller 2019-04-10 16:52:20 +02:00
Tom Hughes
f68cee0f4e Fix queuing of trace imports for API uploads
Fixes #2200
2019-04-03 21:53:16 +01:00
Andy Allan
d5d3975181 Use the trace jobs for creating and destroy traces via the API 2019-03-27 11:40:50 +01:00
Andy Allan
742291a840 Simplify deny_access handling
Now that we have all api controllers inheriting from a common base,
it's easier to override the deny_access handler without having to
switch between both.

Fixes #2064
2019-03-20 14:39:17 +01:00
Andy Allan
3bb07e29ec Refactor api controllers to inherit from a common ApiController 2019-03-20 14:16:15 +01:00
Tom Hughes
141df02e67 Move status into the settings object
Only the very early boot code needs to look at the value
from the environment directly.
2019-03-17 11:15:34 +00:00
Andy Allan
5f59845575 Move the api trace methods into a separate controller under the api namespace 2019-02-28 17:12:28 +01:00