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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/onni/adapters/active_record.rb +7 -2
- data/lib/onni/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8297f8be9323c319bbafc426dfea3d9eaee1c96464e491827b7b3493d61bfb90
|
|
4
|
+
data.tar.gz: c643b87fac64fd84a44326be980a3c40e60549541480740d00458b449fe31e61
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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(
|
|
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