running_count 0.2.1 → 0.2.2

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: d9769dd2bae2b3e9172779c02b1fda8850e0ff744ba079dd3ad1d3c3c9ee5051
4
- data.tar.gz: 6bf8777dcb13bb2f081fa96e755722baa5472925ca91ecd2e4a00f8d9c6c302e
3
+ metadata.gz: e2069615c2c82a292f223497c33c281fa35a5ae0688530276986a93a1fe9840d
4
+ data.tar.gz: d491bd036b523dac945639a0fdff4541828a8cc4d0140c08f59f68f7d1fdb547
5
5
  SHA512:
6
- metadata.gz: 04ea8ca2b545bbdaf8c6d42053b3b531fcbaecad836d8aa0d862b220168ab443274a86ff9fefbe7fd01effcd7c7d7e712ca676c7e242aac7e0d90863f36a84c2
7
- data.tar.gz: d130226b26cac516636e824965782a8722a79e92ce992a22cf0c61ad440b8f7ebacbf00259bd31f9f684190082536de3b5a87d9b24664d13e4f5da7bd2d55204
6
+ metadata.gz: c0f584665feabe320d32e3cb520cbe9a0b616f3624adfe59d9ad62d0aa52ef35d263b2cba164429cee8b72b698c11dbd5ca23b8d12630c37f3d5998c35654ed9
7
+ data.tar.gz: dcea6a4ee0fedc6e1560e4cf8eba9dc3e7977adb11e24314c11fde134a851085d5469f2a18938d7d964a7476b7ad883e19b0df5cf6c7f1b47baffbfb529cb6df
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- running_count (0.2.1)
4
+ running_count (0.2.2)
5
5
  activesupport (>= 4.2.11)
6
6
  pg (= 0.20.0)
7
7
  redis-rails (~> 5.0)
data/README.md CHANGED
@@ -7,7 +7,7 @@ Counter caches for Rails applications, including cached running counts.
7
7
  Add this line to your application's Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'running_count', '~> 0.2`
10
+ gem 'running_count', '~> 0.2.1`
11
11
  ```
12
12
 
13
13
  And then execute:
@@ -57,13 +57,9 @@ module RunningCount
57
57
  def reconcile_changes(counter_data)
58
58
  Statement.prepare_statement(counter_data)
59
59
 
60
- begin
61
- Storage
62
- .scores(counter_data[:running_set_name])
63
- .each { |item, _score| Statement.reconcile_item(item, counter_data) }
64
- ensure
65
- Statement.release_statement(counter_data)
66
- end
60
+ Storage
61
+ .scores(counter_data[:running_set_name])
62
+ .each { |item, _score| Statement.reconcile_item(item, counter_data) }
67
63
  end
68
64
 
69
65
  def running_count(destination, running_set_name)
@@ -19,11 +19,11 @@ module RunningCount
19
19
  end
20
20
 
21
21
  def prepare_statement(counter_data)
22
- ActiveRecord::Base.connection.exec_query(counter_data[:statement_sql])
23
- end
24
-
25
- def release_statement(counter_data)
26
- ActiveRecord::Base.connection.exec_query(counter_data[:release_sql])
22
+ begin
23
+ ActiveRecord::Base.connection.exec_query(counter_data[:statement_sql])
24
+ rescue ActiveRecord::StatementInvalid
25
+ Rails.logger.warn "Statement already exists: #{counter_data[:statement_sql]}"
26
+ end
27
27
  end
28
28
 
29
29
  def reconcile_item(item, counter_data)
@@ -1,3 +1,3 @@
1
1
  module RunningCount
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: running_count
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Priestley