error_radar 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 57a9bb51c11180d90dfedb8bce99c6f6c989c725bc44991a5c6ca42812148713
|
|
4
|
+
data.tar.gz: d4a31ea7b1e3317ddd392584099d5ce7811dd32468985a4d8f8e18c3498c05c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fc4dcc84da998c26f0f348149e9d50b36be365b91f37cd69769a66afd9f0fe8d94c9a5e630496930150acfdb9d9f5b0ec37daef145e00b090e3817ad6d77eacc
|
|
7
|
+
data.tar.gz: fc4b1b73d7f3c4115c6ee3f00f12e8ab48420973ec41bd958ab9edafa27a36dce425d6c69e84a28eeacffc683d06f6cdce270dd06ab8759201b6c042aee44850
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.0.2] - 2026-07-03
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **`has_many :error_occurrences` naming conflict**: renamed the association from
|
|
9
|
+
`:occurrences` to `:error_occurrences` on `ErrorLog` to stop it from shadowing
|
|
10
|
+
the `occurrences` integer column. The collision caused:
|
|
11
|
+
- 500 error on the All Errors page (`e.occurrences > 100` raised
|
|
12
|
+
`NoMethodError` because the column reader returned a `CollectionProxy`)
|
|
13
|
+
- Dashboard kanban cards showing
|
|
14
|
+
`count: #<ActiveRecord_Associations_CollectionProxy …>` instead of the
|
|
15
|
+
integer hit count
|
|
16
|
+
- `log.occurrences += 1` silently broken inside `ErrorLog.record`
|
|
17
|
+
- Updated `ErrorsController#show` and `Api::ErrorsController#serialize` to call
|
|
18
|
+
`error_occurrences` (the association) while leaving all other `log.occurrences`
|
|
19
|
+
calls reading the integer column as before.
|
|
20
|
+
|
|
5
21
|
## [1.0.1] - 2026-07-03
|
|
6
22
|
|
|
7
23
|
### Added
|
|
@@ -102,7 +102,7 @@ module ErrorRadar
|
|
|
102
102
|
|
|
103
103
|
if ErrorRadar.config.track_occurrences
|
|
104
104
|
begin
|
|
105
|
-
data[:recent_occurrences] = log.
|
|
105
|
+
data[:recent_occurrences] = log.error_occurrences.recent.limit(10).map do |occ|
|
|
106
106
|
{
|
|
107
107
|
id: occ.id,
|
|
108
108
|
occurred_at: occ.occurred_at&.iso8601,
|
|
@@ -28,10 +28,10 @@ module ErrorRadar
|
|
|
28
28
|
begin
|
|
29
29
|
@occ_page = [params[:occ_page].to_i, 1].max
|
|
30
30
|
occ_per_page = 20
|
|
31
|
-
@occ_total = @error.
|
|
31
|
+
@occ_total = @error.error_occurrences.count
|
|
32
32
|
@occ_total_pages = [(@occ_total.to_f / occ_per_page).ceil, 1].max
|
|
33
33
|
@occ_page = [@occ_page, @occ_total_pages].min
|
|
34
|
-
@occurrences = @error.
|
|
34
|
+
@occurrences = @error.error_occurrences.recent
|
|
35
35
|
.limit(occ_per_page)
|
|
36
36
|
.offset((@occ_page - 1) * occ_per_page)
|
|
37
37
|
rescue ActiveRecord::StatementInvalid
|
|
@@ -16,9 +16,9 @@ module ErrorRadar
|
|
|
16
16
|
|
|
17
17
|
enum status: { open: 0, in_progress: 1, resolved: 2, ignored: 3 }, _prefix: :status
|
|
18
18
|
|
|
19
|
-
has_many :
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
has_many :error_occurrences, class_name: 'ErrorRadar::ErrorOccurrence',
|
|
20
|
+
foreign_key: :error_log_id,
|
|
21
|
+
dependent: :delete_all
|
|
22
22
|
|
|
23
23
|
has_many :comments, class_name: 'ErrorRadar::ErrorComment',
|
|
24
24
|
foreign_key: :error_log_id,
|
data/lib/error_radar/version.rb
CHANGED