counter_culture 2.7.0 → 3.1.0

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: 74fff95505913ba522b3ec93bc9101c375c7de5678744145a0e4959f2c267361
4
- data.tar.gz: bc284f87da6f949e7d875b7f30c43accbe23ce5716601af9fc4143eb6346954d
3
+ metadata.gz: 461f74df5dfedb6986e9ad3504c20d6a8c173b284011279b853cec7a58fdf57b
4
+ data.tar.gz: ce60aa02f06c3719f2a34020ca065bf6fe07847d7b4e5d238ef263345634e491
5
5
  SHA512:
6
- metadata.gz: e63708745c4ffbb727a1b4da61a0d027de76d7256ee5d9669fa0f18dfcc2b183f26ddc109f45d6af6fb68a79c040e73872f647e8453c7b801e390036601878eb
7
- data.tar.gz: c58c36d4aaf450450d913ad93487c7012de5de0ba8bb4f99c83a3994b64e8aed19f04a0d62c0df21ceda862312b9c010af042857709d891f746e20403ef893f2
6
+ metadata.gz: b706ac60f8dcd3f68e8b7da3a8987caaddfd9d5e0c67cb94923af7188910614c0c991047734e8a4c28d68801e41ab1f77ac975e659615facd6ecdaf96ce58faa
7
+ data.tar.gz: e9b2a3910632ee00a5e6489f339e79f7e3b07be8aee5ef7eddf0e60f82e7af848aedcc63861cf281c833edb9703407ae215fd7b4ea57b792fe74b776ae5a45ca
data/.travis.yml CHANGED
@@ -1,31 +1,49 @@
1
+ dist: focal
1
2
  language: ruby
3
+ cache:
4
+ directories:
5
+ - ~/.rvm/gems
2
6
  services:
3
7
  - postgresql
4
8
  - mysql
9
+ branches:
10
+ only:
11
+ - master
5
12
  addons:
6
- postgresql: "9.6"
13
+ postgresql: '12'
14
+ apt:
15
+ packages:
16
+ - postgresql-12
17
+ - postgresql-client-12
7
18
  rvm:
8
- - "2.5.7"
9
- - "2.6.5"
10
- - "2.7.0"
19
+ - "2.6.8"
20
+ - "2.7.4"
21
+ - "3.0.2"
11
22
  gemfile:
12
- - gemfiles/rails_4.2.gemfile
13
- - gemfiles/rails_5.0.gemfile
14
- - gemfiles/rails_5.1.gemfile
15
23
  - gemfiles/rails_5.2.gemfile
16
24
  - gemfiles/rails_6.0.gemfile
25
+ - gemfiles/rails_6.1.gemfile
17
26
  matrix:
18
27
  exclude:
19
- - rvm: "2.7.0"
20
- gemfile: gemfiles/rails_4.2.gemfile
28
+ - rvm: "3.0.2"
29
+ gemfile: gemfiles/rails_5.2.gemfile
21
30
  env:
31
+ global:
32
+ - PGUSER=postgres
33
+ - PGPORT=5432
34
+ - PGHOST=localhost
35
+ jobs:
22
36
  - DB=postgresql
23
37
  - DB=sqlite3
24
38
  - DB=mysql2
25
39
  before_install:
26
- - gem install bundler -v '1.17.3'
40
+ - sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
41
+ - sudo service postgresql restart
42
+ - sleep 1
43
+ - postgres --version
44
+ - if [ "$BUNDLE_GEMFILE" = "$PWD/gemfiles/rails_4.2.gemfile" ]; then gem install bundler -v '1.17.3'; else gem install bundler -v '> 2'; fi
27
45
  install:
28
- - bundle _1.17.3_ update
46
+ - if [ "$BUNDLE_GEMFILE" = "$PWD/gemfiles/rails_4.2.gemfile" ]; then bundle _1.17.3_ update; else bundle update; fi
29
47
  before_script:
30
48
  - psql -c 'create database counter_culture_test;' -U postgres
31
49
  - mysql -e 'CREATE DATABASE counter_culture_test;'
data/Appraisals CHANGED
@@ -1,9 +1,7 @@
1
1
  %w[
2
- 4.2
3
- 5.0
4
- 5.1
5
2
  5.2
6
3
  6.0
4
+ 6.1
7
5
  ].each do |rails_version|
8
6
  gem_rails_version = Gem::Version.new(rails_version)
9
7
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5.0') &&
@@ -15,8 +13,19 @@
15
13
  appraise "rails-#{rails_version}" do
16
14
  gem 'rails', "~> #{rails_version}.0"
17
15
 
18
- gem 'pg', gem_rails_version < Gem::Version.new('5.0') ? '~> 0.15' : '~> 1.0'
16
+ if gem_rails_version < Gem::Version.new('5.0')
17
+ gem 'pg', '~> 0.15'
18
+ else
19
+ gem 'pg'
20
+ end
19
21
  gem 'mysql2'
20
- gem 'sqlite3', gem_rails_version < Gem::Version.new(5.2) ? '~> 1.3.0' : '~> 1.4'
22
+ if gem_rails_version < Gem::Version.new('5.2')
23
+ gem 'sqlite3', '~> 1.3.0'
24
+ else
25
+ gem 'sqlite3'
26
+ end
27
+ if gem_rails_version < Gem::Version.new('5.0')
28
+ gem 'bigdecimal', '~> 1.3.5'
29
+ end
21
30
  end
22
31
  end
data/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## 3.1.0 (November 29, 2021)
2
+
3
+ Improvements:
4
+ - Allow specifiying a `Proc` to `column_names` to avoid loading a scope on
5
+ startup (#335)
6
+
7
+ ## 3.0.0 (October 26, 2021)
8
+
9
+ Breaking changes:
10
+ - Dropped support for Ruby < 2.6
11
+ - Dropped support for Rails < 5.2
12
+
13
+ Note that there are no specific breaking changes that would cause older
14
+ versions of Ruby or Rails to stop working, we have simply stopped testing
15
+ against them.
16
+
17
+ Improvements:
18
+ - Support PostgreSql's `money` type for use with a delta column (#333)
19
+
20
+ ## 2.9.0 (August 27, 2021)
21
+
22
+ Improvements:
23
+ - Allow `execute_after_commit` to be a `Proc` for dynamic control (#326)
24
+
25
+ ## 2.8.0 (March 16, 2021)
26
+
27
+ Improvements:
28
+ - New `execute_after_commit` option (#309)
29
+
1
30
  ## 2.7.0 (November 16, 2020)
2
31
 
3
32
  Improvements:
data/Gemfile CHANGED
@@ -4,6 +4,3 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify the gem's dependencies in counter_culture.gemspec
6
6
  gemspec
7
-
8
- # Ensure we have the default DB adapter for testing
9
- gem 'sqlite3'
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # counter_culture [![Build Status](https://travis-ci.com/magnusvk/counter_culture.svg)](https://travis-ci.com/magnusvk/counter_culture)
1
+ # counter_culture [![Build Status](https://app.travis-ci.com/magnusvk/counter_culture.svg?branch=master)](https://app.travis-ci.com/magnusvk/counter_culture)
2
2
 
3
3
  Turbo-charged counter caches for your Rails app. Huge improvements over the Rails standard counter caches:
4
4
 
@@ -7,7 +7,7 @@ Turbo-charged counter caches for your Rails app. Huge improvements over the Rail
7
7
  * Supports dynamic column names, making it possible to split up the counter cache for different types of objects
8
8
  * Can keep a running count, or a running total
9
9
 
10
- Tested against Ruby 2.3.8, 2.4.7, 2.5.6 and 2.6.4 and against the latest patch releases of Rails 4.2, 5.0, 5.1, 5.2 and 6.0.
10
+ Tested against Ruby 2.5.8, 2.6.6, 2.7.2 and 3.0.0, and against the latest patch releases of Rails 4.2, 5.0, 5.1, 5.2, 6.0 and 6.1.
11
11
 
12
12
  Please note that -- unlike Rails' built-in counter-caches -- counter_culture does not currently change the behavior of the `.size` method on ActiveRecord associations. If you want to avoid a database query and read the cached value, please use the attribute name containing the counter cache directly.
13
13
  ```
@@ -250,6 +250,28 @@ You may also specify a custom timestamp column that gets updated only when a par
250
250
 
251
251
  With this option, any time the `category_counter_cache` changes both the `category_count_changed` and `updated_at` columns will get updated.
252
252
 
253
+ ### Avoiding deadlocks / executing counter cache updates after commit
254
+
255
+ Some applications run into issues with deadlocks involving counter cache updates when using this gem. See [#263](https://github.com/magnusvk/counter_culture/issues/263#issuecomment-772284439) for information and helpful links on how to avoid this issue.
256
+
257
+ Another option is to simply defer the update of counter caches to outside of the transaction. This gives up transacrtional guarantees for your counter cache updates but should resolve any deadlocks you experience. This behavior is disabled by default, enable it on each affected counter cache as follows:
258
+
259
+ ```ruby
260
+ counter_culture :category, execute_after_commit: true
261
+ ```
262
+ [NOTE] You need to manually specify the `after_commit_action` as dependency in the Gemfile to use this feature
263
+ ```ruby
264
+ ...
265
+ gem "after_commit_action"
266
+ ...
267
+ ```
268
+
269
+ You can also pass a `Proc` for dynamic control. This is useful for temporarily moving the counter cache update inside of the transaction:
270
+
271
+ ```ruby
272
+ counter_culture :category, execute_after_commit: proc { !Thread.current[:update_counter_cache_in_transaction] }
273
+ ```
274
+
253
275
  ### Manually populating counter cache values
254
276
 
255
277
  You will sometimes want to populate counter-cache values from primary data. This is required when adding counter-caches to existing data. It is also recommended to run this regularly (at BestVendor, we run it once a week) to catch any incorrect values in the counter caches.
@@ -354,7 +376,10 @@ class Product < ActiveRecord::Base
354
376
  end
355
377
  ```
356
378
 
357
- You can specify a scope instead of a where condition string for `column_names`:
379
+ You can specify a scope instead of a where condition string for `column_names`. We recommend
380
+ providing a Proc that returns a hash instead of directly providing a hash: If you were to directly
381
+ provide a scope this would load your schema cache on startup which will break things like
382
+ `rake db:migrate`.
358
383
 
359
384
  ```ruby
360
385
  class Product < ActiveRecord::Base
@@ -364,10 +389,10 @@ class Product < ActiveRecord::Base
364
389
 
365
390
  counter_culture :category,
366
391
  column_name: proc {|model| "#{model.product_type}_count" },
367
- column_names: {
392
+ column_names: -> { {
368
393
  Product.awesomes => :awesome_count,
369
394
  Product.suckys => :sucky_count
370
- }
395
+ } }
371
396
  end
372
397
  ```
373
398
 
@@ -446,4 +471,4 @@ counter_culture now supports polymorphic associations of one level only.
446
471
 
447
472
  ## Copyright
448
473
 
449
- Copyright (c) 2012-2013 BestVendor, Magnus von Koeller. See LICENSE.txt for further details.
474
+ Copyright (c) 2012-2021 BestVendor, Magnus von Koeller. See LICENSE.txt for further details.
@@ -30,11 +30,12 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.add_development_dependency 'appraisal', '> 2.0.0'
32
32
  spec.add_development_dependency 'awesome_print'
33
- spec.add_development_dependency 'bundler', '~> 1.17'
33
+ spec.add_development_dependency 'bundler'
34
34
  spec.add_development_dependency 'database_cleaner', '>= 1.1.1'
35
35
  spec.add_development_dependency 'discard'
36
36
  spec.add_development_dependency 'paper_trail'
37
37
  spec.add_development_dependency 'paranoia'
38
+ spec.add_development_dependency 'after_commit_action'
38
39
  spec.add_development_dependency 'rails', '>= 4.2'
39
40
  spec.add_development_dependency 'rake', '>= 10.0'
40
41
  spec.add_development_dependency 'rdoc', '~> 5.0.0'
@@ -42,4 +43,7 @@ Gem::Specification.new do |spec|
42
43
  spec.add_development_dependency 'rspec-extra-formatters'
43
44
  spec.add_development_dependency 'simplecov', '~> 0.16.1'
44
45
  spec.add_development_dependency 'timecop'
46
+ spec.add_development_dependency 'sqlite3'
47
+ spec.add_development_dependency 'mysql2'
48
+ spec.add_development_dependency 'pg'
45
49
  end
@@ -2,9 +2,9 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3", "~> 1.4"
5
+ gem "sqlite3"
6
6
  gem "rails", "~> 5.2.0"
7
- gem "pg", "~> 1.0"
7
+ gem "pg"
8
8
  gem "mysql2"
9
9
 
10
10
  gemspec path: "../"
@@ -2,9 +2,9 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3", "~> 1.4"
5
+ gem "sqlite3"
6
6
  gem "rails", "~> 6.0.0"
7
- gem "pg", "~> 1.0"
7
+ gem "pg"
8
8
  gem "mysql2"
9
9
 
10
10
  gemspec path: "../"
@@ -2,9 +2,9 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sqlite3", "~> 1.3.0"
6
- gem "rails", "~> 5.0.0"
7
- gem "pg", "~> 1.0"
5
+ gem "sqlite3"
6
+ gem "rails", "~> 6.1.0"
7
+ gem "pg"
8
8
  gem "mysql2"
9
9
 
10
10
  gemspec path: "../"
@@ -1,6 +1,6 @@
1
1
  module CounterCulture
2
2
  class Counter
3
- CONFIG_OPTIONS = [ :column_names, :counter_cache_name, :delta_column, :foreign_key_values, :touch, :delta_magnitude]
3
+ CONFIG_OPTIONS = [ :column_names, :counter_cache_name, :delta_column, :foreign_key_values, :touch, :delta_magnitude, :execute_after_commit ]
4
4
  ACTIVE_RECORD_VERSION = Gem.loaded_specs["activerecord"].version
5
5
 
6
6
  attr_reader :model, :relation, *CONFIG_OPTIONS
@@ -9,10 +9,6 @@ module CounterCulture
9
9
  @model = model
10
10
  @relation = relation.is_a?(Enumerable) ? relation : [relation]
11
11
 
12
- if options.fetch(:execute_after_commit, false)
13
- fail("execute_after_commit was removed; updates now run within the transaction")
14
- end
15
-
16
12
  @counter_cache_name = options.fetch(:column_name, "#{model.name.demodulize.tableize}_count")
17
13
  @column_names = options[:column_names]
18
14
  @delta_column = options[:delta_column]
@@ -20,6 +16,18 @@ module CounterCulture
20
16
  @touch = options.fetch(:touch, false)
21
17
  @delta_magnitude = options[:delta_magnitude] || 1
22
18
  @with_papertrail = options.fetch(:with_papertrail, false)
19
+ @execute_after_commit = options.fetch(:execute_after_commit, false)
20
+
21
+ if @execute_after_commit
22
+ begin
23
+ require 'after_commit_action'
24
+ rescue LoadError
25
+ fail(LoadError.new(
26
+ "You need to include the `after_commit_action` gem in your "\
27
+ "gem dependencies to use the execute_after_commit option"))
28
+ end
29
+ model.include(AfterCommitAction)
30
+ end
23
31
  end
24
32
 
25
33
  # increments or decrements a counter cache
@@ -61,10 +69,16 @@ module CounterCulture
61
69
  "#{model.connection.quote_column_name(change_counter_column)}"
62
70
  end
63
71
 
72
+ column_type = klass.type_for_attribute(change_counter_column).type
73
+
64
74
  # we don't use Rails' update_counters because we support changing the timestamp
65
75
  updates = []
66
76
  # this updates the actual counter
67
- updates << "#{quoted_column} = COALESCE(#{quoted_column}, 0) #{operator} #{delta_magnitude}"
77
+ if column_type == :money
78
+ updates << "#{quoted_column} = COALESCE(CAST(#{quoted_column} as NUMERIC), 0) #{operator} #{delta_magnitude}"
79
+ else
80
+ updates << "#{quoted_column} = COALESCE(#{quoted_column}, 0) #{operator} #{delta_magnitude}"
81
+ end
68
82
  # and here we update the timestamp, if so desired
69
83
  if touch
70
84
  current_time = obj.send(:current_time_from_proper_timezone)
@@ -93,14 +107,20 @@ module CounterCulture
93
107
  instance.send("#{timestamp_column}=", current_time)
94
108
  end
95
109
 
96
- instance.paper_trail.save_with_version(validate: false)
110
+ execute_now_or_after_commit(obj) do
111
+ instance.paper_trail.save_with_version(validate: false)
112
+ end
97
113
  else
98
- instance.paper_trail.touch_with_version
114
+ execute_now_or_after_commit(obj) do
115
+ instance.paper_trail.touch_with_version
116
+ end
99
117
  end
100
118
  end
101
119
  end
102
120
 
103
- klass.where(primary_key => id_to_change).update_all updates.join(', ')
121
+ execute_now_or_after_commit(obj) do
122
+ klass.where(primary_key => id_to_change).update_all updates.join(', ')
123
+ end
104
124
  end
105
125
  end
106
126
 
@@ -296,6 +316,16 @@ module CounterCulture
296
316
  prev
297
317
  end
298
318
 
319
+ def execute_now_or_after_commit(obj, &block)
320
+ execute_after_commit = @execute_after_commit.is_a?(Proc) ? @execute_after_commit.call : @execute_after_commit
321
+
322
+ if execute_after_commit
323
+ obj.execute_after_commit(&block)
324
+ else
325
+ block.call
326
+ end
327
+ end
328
+
299
329
  private
300
330
  def attribute_was(obj, attr)
301
331
  changes_method =
@@ -45,8 +45,19 @@ module CounterCulture
45
45
  @after_commit_counter_cache = []
46
46
  end
47
47
 
48
- if options[:column_names] && !options[:column_names].is_a?(Hash)
49
- raise ":column_names must be a Hash of conditions and column names"
48
+ column_names_valid = (
49
+ !options[:column_names] ||
50
+ options[:column_names].is_a?(Hash) ||
51
+ (
52
+ options[:column_names].is_a?(Proc) &&
53
+ options[:column_names].call.is_a?(Hash)
54
+ )
55
+ )
56
+ unless column_names_valid
57
+ raise ArgumentError.new(
58
+ ":column_names must be a Hash of conditions and column names, " \
59
+ "or a Proc that when called returns such a Hash"
60
+ )
50
61
  end
51
62
 
52
63
  # add the counter to our collection
@@ -74,7 +74,15 @@ module CounterCulture
74
74
 
75
75
  scope = relation_class
76
76
 
77
- counter_column_names = column_names || {nil => counter_cache_name}
77
+ counter_column_names =
78
+ case column_names
79
+ when Proc
80
+ column_names.call
81
+ when Hash
82
+ column_names
83
+ else
84
+ { nil => counter_cache_name }
85
+ end
78
86
 
79
87
  if options[:column_name]
80
88
  counter_column_names = counter_column_names.select{ |_, v| options[:column_name].to_s == v }
@@ -187,7 +195,12 @@ module CounterCulture
187
195
  # if a delta column is provided use SUM, otherwise use COUNT
188
196
  return @count_select if @count_select
189
197
  if delta_column
190
- @count_select = "SUM(COALESCE(#{self_table_name}.#{delta_column},0))"
198
+ # cast the column as NUMERIC if it is a PG money type
199
+ if model.type_for_attribute(delta_column).type == :money
200
+ @count_select = "SUM(COALESCE(CAST(#{self_table_name}.#{delta_column} as NUMERIC),0))"
201
+ else
202
+ @count_select = "SUM(COALESCE(#{self_table_name}.#{delta_column}, 0))"
203
+ end
191
204
  else
192
205
  @count_select = "COUNT(#{self_table_name}.#{model.primary_key})*#{delta_magnitude}"
193
206
  end
@@ -1,3 +1,3 @@
1
1
  module CounterCulture
2
- VERSION = '2.7.0'.freeze
2
+ VERSION = '3.1.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: counter_culture
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus von Koeller
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-16 00:00:00.000000000 Z
11
+ date: 2021-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '1.17'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '1.17'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: database_cleaner
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: after_commit_action
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: rails
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -234,6 +248,48 @@ dependencies:
234
248
  - - ">="
235
249
  - !ruby/object:Gem::Version
236
250
  version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: sqlite3
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ - !ruby/object:Gem::Dependency
266
+ name: mysql2
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - ">="
270
+ - !ruby/object:Gem::Version
271
+ version: '0'
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - ">="
277
+ - !ruby/object:Gem::Version
278
+ version: '0'
279
+ - !ruby/object:Gem::Dependency
280
+ name: pg
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - ">="
284
+ - !ruby/object:Gem::Version
285
+ version: '0'
286
+ type: :development
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - ">="
291
+ - !ruby/object:Gem::Version
292
+ version: '0'
237
293
  description: counter_culture provides turbo-charged counter caches that are kept up-to-date
238
294
  not just on create and destroy, that support multiple levels of indirection through
239
295
  relationships, allow dynamic column names and that avoid deadlocks by updating in
@@ -258,11 +314,9 @@ files:
258
314
  - Rakefile
259
315
  - circle.yml
260
316
  - counter_culture.gemspec
261
- - gemfiles/rails_4.2.gemfile
262
- - gemfiles/rails_5.0.gemfile
263
- - gemfiles/rails_5.1.gemfile
264
317
  - gemfiles/rails_5.2.gemfile
265
318
  - gemfiles/rails_6.0.gemfile
319
+ - gemfiles/rails_6.1.gemfile
266
320
  - lib/counter_culture.rb
267
321
  - lib/counter_culture/counter.rb
268
322
  - lib/counter_culture/extensions.rb
@@ -270,7 +324,6 @@ files:
270
324
  - lib/counter_culture/version.rb
271
325
  - lib/generators/counter_culture_generator.rb
272
326
  - lib/generators/templates/counter_culture_migration.rb.erb
273
- - run_tests_locally.sh
274
327
  homepage: https://github.com/magnusvk/counter_culture
275
328
  licenses:
276
329
  - MIT
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sqlite3", "~> 1.3.0"
6
- gem "rails", "~> 4.2.0"
7
- gem "pg", "~> 0.15"
8
- gem "mysql2"
9
-
10
- gemspec path: "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sqlite3", "~> 1.3.0"
6
- gem "rails", "~> 5.1.0"
7
- gem "pg", "~> 1.0"
8
- gem "mysql2"
9
-
10
- gemspec path: "../"
data/run_tests_locally.sh DELETED
@@ -1,20 +0,0 @@
1
- #! /bin/bash
2
-
3
- set -e
4
- source /usr/local/share/chruby/chruby.sh
5
-
6
- for RUBY_VERSION in 2.5.7 2.6.5 2.7.0; do
7
- chruby $RUBY_VERSION
8
- ruby --version
9
-
10
- gem install bundler -v '1.17.3'
11
-
12
- (bundle _1.17.3_ check > /dev/null || bundle _1.17.3_ install)
13
- gem install appraisal
14
- bundle exec appraisal install
15
-
16
- for DB in mysql2 postgresql sqlite3; do
17
- echo "RUBY $RUBY_VERSION; DB $DB"
18
- DB=$DB bundle exec appraisal rspec spec/counter_culture_spec.rb
19
- done
20
- done