counter_culture 3.8.0 → 3.8.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: 225d25bff8cd9226371b162e6761603271cbac02c74be1dd7398de2dc63dbb71
4
- data.tar.gz: ea2b215508e285bab75efcbf3aeb153a15458c22db0cc0b79350bb2e9b3a9e05
3
+ metadata.gz: 13f043a04b7cca0b364e7692c19425b049b45b4e965ed5caac0dbac2f91622c1
4
+ data.tar.gz: 50dfedf030e3c3823829aedc5e3b2a08fe65b63b50fc439d229afb5ab3fa5d5d
5
5
  SHA512:
6
- metadata.gz: 5362e9b1db5c4a81944e3deeddec9c7945ae349cca9f663dae140fb1516f00b9bd41d4d34af4705c2d4600ee65dabe2a41bc0a53e1a98ba682385228b0f4e41a
7
- data.tar.gz: 60d99dab523e3f339961c4d19393f27de41006c361dc190baf25676157dded5b98382d77cca3dd76533cb070e3eec14965bb90ffe3f13991ba6d409cdf3e779a
6
+ metadata.gz: 604bd858a6660d3e83b74b339a2675366b5d7908c87c37241ed9eb9a2b245ddb4d02b19d6782d3c30df793cd895be45e22455e34f9aca88e5fee462f472c2a48
7
+ data.tar.gz: a5828bb5f0bd66b6717401b47f8494687a371546c6f3df89c93dd9a524a055e074aeffc3fa6c02e0b2e2cd25c3e706e76c2ef654e22a0b3f48cfb3d0c0c401b7
data/Appraisals CHANGED
@@ -7,7 +7,7 @@
7
7
  7.2
8
8
  ].each do |rails_version|
9
9
  appraise "rails-#{rails_version}" do
10
- gem 'rails', "~> #{rails_version}.0"
10
+ gem 'activerecord', "~> #{rails_version}.0"
11
11
  if Gem::Version.new(rails_version) < Gem::Version.new("7.2")
12
12
  gem 'sqlite3', "~> 1.4"
13
13
  end
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 3.8.2 (October 21, 2024)
2
+
3
+ Bugfixes:
4
+ - Use ActiveRecord version, not Rails version, to make it possible to use `counter_culture_fix_counts` without Rails
5
+ - Tests no longer require Rails, making sure we do not introduce this regression again
6
+
7
+ ## 3.8.1 (October 18, 2024)
8
+
9
+ Bugfixes:
10
+ - Fix compatibility with `mobility` gem by skipping attributes that don't exist in the database but show up in `saved_changes` (#401)
11
+
1
12
  ## 3.8.0 (October 4, 2024)
2
13
 
3
14
  New features:
@@ -263,7 +274,7 @@ Bugfixes:
263
274
  ## 1.8.1 (September 5, 2017)
264
275
 
265
276
  Improvements:
266
- - Use ActiveRecord version, not Rails version, in `Reconciler`, makeing it possible to use `counter_culture_fix_counts` without Rails
277
+ - Use ActiveRecord version, not Rails version, in `Reconciler`, making it possible to use `counter_culture_fix_counts` without Rails
267
278
 
268
279
  ## 1.8.0 (August 30, 2017)
269
280
 
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency 'paper_trail'
37
37
  spec.add_development_dependency 'paranoia'
38
38
  spec.add_development_dependency 'after_commit_action'
39
- spec.add_development_dependency 'rails', '>= 4.2'
39
+ spec.add_development_dependency 'activerecord', '>= 4.2'
40
40
  spec.add_development_dependency 'rake', '>= 10.0'
41
41
  spec.add_development_dependency 'rdoc', ">= 6.3.1"
42
42
  spec.add_development_dependency 'rspec', '~> 3.0'
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 5.2.0"
5
+ gem "activerecord", "~> 5.2.0"
6
6
  gem "sqlite3", "~> 1.4"
7
7
 
8
8
  gemspec path: "../"
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 6.0.0"
5
+ gem "activerecord", "~> 6.0.0"
6
6
  gem "sqlite3", "~> 1.4"
7
7
 
8
8
  gemspec path: "../"
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 6.1.0"
5
+ gem "activerecord", "~> 6.1.0"
6
6
  gem "sqlite3", "~> 1.4"
7
7
 
8
8
  gemspec path: "../"
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 7.0.0"
5
+ gem "activerecord", "~> 7.0.0"
6
6
  gem "sqlite3", "~> 1.4"
7
7
 
8
8
  gemspec path: "../"
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 7.1.0"
5
+ gem "activerecord", "~> 7.1.0"
6
6
  gem "sqlite3", "~> 1.4"
7
7
 
8
8
  gemspec path: "../"
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 7.2.0"
5
+ gem "activerecord", "~> 7.2.0"
6
6
 
7
7
  gemspec path: "../"
@@ -332,6 +332,8 @@ module CounterCulture
332
332
 
333
333
  changes_method = ACTIVE_RECORD_VERSION >= Gem::Version.new("5.1.0") ? :saved_changes : :changed_attributes
334
334
  obj.public_send(changes_method).each do |key, value|
335
+ next unless obj.has_attribute?(key.to_s)
336
+
335
337
  old_value = ACTIVE_RECORD_VERSION >= Gem::Version.new("5.1.0") ? value.first : value
336
338
  # We set old values straight to AR @attributes variable to avoid
337
339
  # write_attribute callbacks from other gems (e.g. ArTransactionChanges)
@@ -181,17 +181,17 @@ module CounterCulture
181
181
  def log(message)
182
182
  return unless log?
183
183
 
184
- Rails.logger.info(message)
184
+ ActiveRecord::Base.logger.info(message)
185
185
  end
186
186
 
187
187
  def log_without_newline(message)
188
188
  return unless log?
189
189
 
190
- Rails.logger << message if Rails.logger.info?
190
+ ActiveRecord::Base.logger << message if ActiveRecord::Base.logger.info?
191
191
  end
192
192
 
193
193
  def log?
194
- options[:verbose] && Rails.logger
194
+ options[:verbose] && ActiveRecord::Base.logger
195
195
  end
196
196
 
197
197
  # keep track of what we fixed, e.g. for a notification email
@@ -1,3 +1,3 @@
1
1
  module CounterCulture
2
- VERSION = '3.8.0'.freeze
2
+ VERSION = '3.8.2'.freeze
3
3
  end
@@ -23,11 +23,11 @@ module CounterCulture
23
23
  private
24
24
 
25
25
  def rails_7_1?
26
- Gem::Requirement.new('~> 7.1.0').satisfied_by?(Gem::Version.new(Rails.version))
26
+ Gem::Requirement.new('~> 7.1.0').satisfied_by?(ActiveRecord.version)
27
27
  end
28
28
 
29
29
  def rails_7_2_or_greater?
30
- Gem::Requirement.new('>= 7.2.0').satisfied_by?(Gem::Version.new(Rails.version))
30
+ Gem::Requirement.new('>= 7.2.0').satisfied_by?(ActiveRecord.version)
31
31
  end
32
32
  end
33
33
  end
@@ -27,8 +27,8 @@ class CounterCultureGenerator < ActiveRecord::Generators::Base
27
27
  end
28
28
 
29
29
  def migration_version
30
- if Gem::Version.new(Rails.version) >= Gem::Version.new('5.0.0')
31
- "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
30
+ if ActiveRecord.version >= Gem::Version.new('5.0.0')
31
+ "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
32
32
  end
33
33
  end
34
34
 
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: 3.8.0
4
+ version: 3.8.2
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: 2024-10-04 00:00:00.000000000 Z
11
+ date: 2024-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -151,7 +151,7 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: rails
154
+ name: activerecord
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="