onni 0.1.0 → 0.1.1

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: 4adac16f882a9d8562e9441200c4e11f1a7c4dc49d0e577a2d0620ce11db1789
4
- data.tar.gz: 95e396d99bf6a7f609fd4b6500d8db02ddf80103c07ce1d13b94e74672a71147
3
+ metadata.gz: 8297f8be9323c319bbafc426dfea3d9eaee1c96464e491827b7b3493d61bfb90
4
+ data.tar.gz: c643b87fac64fd84a44326be980a3c40e60549541480740d00458b449fe31e61
5
5
  SHA512:
6
- metadata.gz: b234b572464676742136aa0b26a006408fdd0907189b3098a1aa794033309a9180b1bb763c7bc86d39c48bde47ff578b5793529ccd2d475906c4f6a2db8e5f03
7
- data.tar.gz: '069c548695c4ebeb0a89868ef4351a09a06308199c819f83241a31f03c3e1d1823966b90e5dd4bee418b41489a72ef5f2b0b082a09dfb5562abbcf6154b4f223'
6
+ metadata.gz: c1985bf48570c1f4caf0fec3372669d1cf843d5e23a53ffb9334ca780ae042a32654a83d1387c0646cce50f52c0ce6f4481ae4a5ad3c31b547f30611ace04569
7
+ data.tar.gz: 4c9da41c69f15728231c13d059d19a1d40de7d2ed3bc7e9270a74d0795da4e3a93b9f298dc40cbea8766792141f225cad010812621b0f4331f3c67d906b23f96
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.1.1 (2026-11-12)
4
+
5
+ - Fix PostgreSQL hit stats upsert so `enabled_hits` / `disabled_hits` record again (ambiguous column with `excluded`)
6
+
3
7
  ## 0.1.0 (2026-11-12)
4
8
 
5
9
  - Add feature evaluation charts with 24-hour, 7-day, and 30-day history, enabled share, expandable counts, and replaceable views
data/README.md CHANGED
@@ -202,7 +202,7 @@ Host tips:
202
202
 
203
203
  ### Other ActiveRecord dialects
204
204
 
205
- PostgreSQL uses the same `excluded.*` upsert form. If a host dialect rejects `excluded.*`, override `Adapters::ActiveRecord#record_stat` / `#record_stats_batch` or patch the `on_duplicate` fragment for that adapter.
205
+ PostgreSQL uses the same `excluded.*` upsert form. The conflict `SET` keeps a bare assignment target and qualifies the existing-row hit column on the RHS (`enabled_hits = onni_feature_stat_buckets.enabled_hits + ...`) so PostgreSQL does not treat the bare name as ambiguous with `excluded`. If a host dialect rejects `excluded.*`, override `Adapters::ActiveRecord#record_stat` / `#record_stats_batch` or patch the `on_duplicate` fragment for that adapter.
206
206
 
207
207
  ## ActiveAdmin dashboard access
208
208
 
@@ -108,7 +108,10 @@ module Onni
108
108
  period_start = Time.current.utc.beginning_of_hour
109
109
  now = Time.current
110
110
  column = enabled ? "enabled_hits" : "disabled_hits"
111
- # Intent: column conflict target matches index_onni_feature_stats_unique (SQLite + PostgreSQL ON CONFLICT).
111
+ table = ::Onni::StatBucket.table_name
112
+ # Intent: unique_by matches index_onni_feature_stats_unique. Qualify the existing-row
113
+ # column on the RHS; bare names are ambiguous with excluded on PostgreSQL ON CONFLICT.
114
+ # SET targets stay bare (PostgreSQL rejects table-qualified assignment targets).
112
115
  ::Onni::StatBucket.upsert(
113
116
  {
114
117
  feature_key: key.to_s,
@@ -120,7 +123,9 @@ module Onni
120
123
  updated_at: now
121
124
  },
122
125
  unique_by: %i[feature_key period period_start],
123
- on_duplicate: ::Arel.sql("#{column} = #{column} + #{weight}, updated_at = excluded.updated_at")
126
+ on_duplicate: ::Arel.sql(
127
+ "#{column} = #{table}.#{column} + #{weight}, updated_at = excluded.updated_at"
128
+ )
124
129
  )
125
130
  end
126
131
  end
data/lib/onni/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onni
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onni
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Makarov