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: fa57ddbff3b17adcf34ffe470d8737be97f101ab213d90fa5f8539935b7a0e9b
4
- data.tar.gz: 3212bdf3d554b2c1f660bf42fd687afeb0707933c7cd67ca983b1bbbb01c7848
3
+ metadata.gz: 57a9bb51c11180d90dfedb8bce99c6f6c989c725bc44991a5c6ca42812148713
4
+ data.tar.gz: d4a31ea7b1e3317ddd392584099d5ce7811dd32468985a4d8f8e18c3498c05c0
5
5
  SHA512:
6
- metadata.gz: 31f315fbcdadf71bc578b82d8afb954f95410bda352889107240973832f4984d4fa4002a599a6abdc7852a38a1b6ebaeed0874acfe79d1fb69ff5c2f9c3fe956
7
- data.tar.gz: '04749c0c4ed4aaa062bbbd0bc30cfbed743b61ae072e3300c67c7cf6f7518e52fab74664efbe36465f4f5102016605d136fe454c103102026e80f064de8e5957'
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.occurrences.recent.limit(10).map do |occ|
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.occurrences.count
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.occurrences.recent
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 :occurrences, class_name: 'ErrorRadar::ErrorOccurrence',
20
- foreign_key: :error_log_id,
21
- dependent: :delete_all
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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ErrorRadar
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: error_radar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - chienbn9x