atomically 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4cd43d76a8ee02e70abdfe675dd3bf47047749d076f392ae117ceb28d52c270
4
- data.tar.gz: 503c635e9e29701623b2a46615ac19b3da0b61e601f604e14f5ba9e498e5ebff
3
+ metadata.gz: 920b276434066c1fd3d0172fe14ef28d818d17aaf8f7c4c5c12bff0554631daf
4
+ data.tar.gz: b89ddf56fbe003a5d54a085b66c46e854462eae6f40c28843b5c19f835bb7127
5
5
  SHA512:
6
- metadata.gz: 8cecca409c00e5495b0d406795cb414a4a9eb57babf630c7dadd918119f92a3ea45cec32b916b224a4b48da4b1a92bb6464bf8782db39c24608c142451ef9506
7
- data.tar.gz: 3b109442240656564ee4b10a699e180613c76ce9d6006e8667f57c42f811ab4c9e918601bd59bad80c042ef1830a8bb8cdede0db66bf1fe96f02166b64574249
6
+ metadata.gz: 15edd248d731a80e0e2797cc32fd046f224d0e094691ee3e3740923fb4372877b3041d7436c8685e658476959a5da7022519d2a83eb39c56345e491f14395221
7
+ data.tar.gz: aee6b53ff12ccf5424073746812b84f269f94e08bda83998f7b2ca60d7672b5a6c54e5053388b1ab14eca36b3041e7d3c2b90282c411caaa664e4b736810d75c
@@ -1,5 +1,9 @@
1
1
  ## Change Log
2
2
 
3
+ ### [v1.0.5](https://github.com/khiav223577/atomically/compare/v1.0.4...v1.0.5) 2019/01/28
4
+ - [#9](https://github.com/khiav223577/atomically/pull/9) Implement `decrement_unsigned_counters` (@khiav223577)
5
+ - [#8](https://github.com/khiav223577/atomically/pull/8) Fix: broken test cases after bundler 2.0 was released (@khiav223577)
6
+
3
7
  ### [v1.0.4](https://github.com/khiav223577/atomically/compare/v1.0.3...v1.0.4) 2018/12/21
4
8
  - [#7](https://github.com/khiav223577/atomically/pull/7) Implement `update_all_and_get_ids` (@khiav223577)
5
9
  - [#6](https://github.com/khiav223577/atomically/pull/6) Add warning (@kakas)
@@ -11,6 +15,6 @@
11
15
  ### [v1.0.2](https://github.com/khiav223577/atomically/compare/v1.0.1...v1.0.2) 2018/11/27
12
16
  - [#3](https://github.com/khiav223577/atomically/pull/3) Implement `update` (@khiav223577)
13
17
 
14
- ### v1.0.1 2018/11/22
18
+ ### [v1.0.1](https://github.com/khiav223577/atomically/compare/v1.0.0...v1.0.1) 2018/11/22
15
19
  - [#2](https://github.com/khiav223577/atomically/pull/2) Implement `pay_all` (@khiav223577)
16
20
  - [#1](https://github.com/khiav223577/atomically/pull/1) Implement `create_or_plus` (@khiav223577)
data/README.md CHANGED
@@ -230,6 +230,8 @@ WHERE `arenas`.`id` = 1752
230
230
 
231
231
  Decrement numeric fields via a direct SQL update, and make sure that it will not become negative.
232
232
 
233
+ Return true if update successfully, false otherwise.
234
+
233
235
 
234
236
  #### Parameters
235
237
 
@@ -55,7 +55,7 @@ class Atomically::QueryService
55
55
  def decrement_unsigned_counters(counters)
56
56
  result = open_update_all_scope do
57
57
  counters.each do |field, amount|
58
- where("#{field} > ?", amount).update("#{field} = #{field} - ?", amount) if amount > 0
58
+ where("#{field} >= ?", amount).update("#{field} = #{field} - ?", amount) if amount > 0
59
59
  end
60
60
  end
61
61
  return (result == 1)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Atomically
4
- VERSION = '1.0.5'
4
+ VERSION = '1.0.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atomically
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - khiav reoy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-28 00:00:00.000000000 Z
11
+ date: 2019-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler