counterwise 0.1.4 → 0.1.5

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: 4486834d3cd8109cdc40ecd6cdcb7d9b40b689960550d1c68bbadb564d548726
4
- data.tar.gz: b839de58dfe853a2b8f45414cc184053104fed3568cdbcb3569bbde060a10c6a
3
+ metadata.gz: 3058578dbb5742b22c61ec6bfbd79253bd39886684760bd1afe2674c4e97eb00
4
+ data.tar.gz: 8cd7bb0ad3fd770090cd3a156dca65a7d5c6dd9ba607dbcce500c6c94f182a31
5
5
  SHA512:
6
- metadata.gz: 76a8089e1a783202ab3401982ea3877e12138fe6ea379478113d6f1ce5daae2ae252255201c4195b1ce12b8507b7494c2dda0c4f1f67445a765c31d74d31338b
7
- data.tar.gz: c542c109b5431240594f2d9ba22c8c8acd8503fa54231f0932ef67fc7d108cd9e7451310340113ba837967600bb4c7aafbb43a2766a84d821563cc130b56e514
6
+ metadata.gz: 2ebfb183bba510a0e2322e73d7881fed711369575ceb1c48fa128ccacb1482fdec5dbc7b631232d3de0c9f84c4ea4c9620552b96b82212a1751be209ea6d29ec
7
+ data.tar.gz: 5ed67f84bfffa86e5d438477a4c8f184cfa7b6e0bd26040e56defca7b3ba5877527c57a78b3d9f5868c75860d7b305225c82be24665761b9d3d7952a6bd3809f
@@ -9,15 +9,7 @@ module Counter::Recalculatable
9
9
  else
10
10
  with_lock do
11
11
  new_value = definition.sum? ? sum_by_sql : count_by_sql
12
-
13
- self.class.upsert(
14
- attributes.without("id", "created_at", "updated_at").symbolize_keys.merge(value: new_value),
15
- unique_by: [:parent_type, :parent_id, :name],
16
- on_duplicate: Arel.sql("value = counter_values.value + EXCLUDED.value"),
17
- record_timestamps: true
18
- )
19
-
20
- reload
12
+ update! value: new_value
21
13
  end
22
14
  end
23
15
  end
@@ -1,3 +1,3 @@
1
1
  module Counter
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: counterwise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Lawrence
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-08 00:00:00.000000000 Z
11
+ date: 2024-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails