enum_errors_away 0.2.0 → 0.3.1

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: fbe151509078a04c5bacc1ae9e55045862c88bf07667c074819663182978c7e5
4
- data.tar.gz: f2636c4810ed920e7788ab77cd4748675488b11dc59e24b507c1fa1862a8b332
3
+ metadata.gz: a042969d984fbb4972117e18c9a8f8d95b3cf83cd517ff8bfa52d2fd5356bdd2
4
+ data.tar.gz: cce23409d8eafac9e6cd2a8230127ef6060644f81fc6bd7b5871bb15cfc2ddb4
5
5
  SHA512:
6
- metadata.gz: f65d43b1fdd8a378d7b330253fcd7176ede563842ec95966d201095b78c28dfc50eebddad1277e5e649dabfb506a7375072093761d95b39094b027e2269d4a9c
7
- data.tar.gz: af65006890e0be05107a1f4304a669f8c293e55584e05311c9d0042b9d6ab09f32d47f27b1da3d9b07da461ec9c58c085d2b4450fe46356290e8bad849976b43
6
+ metadata.gz: 6fd2754ab0fc90df56e0170f6b61f37083c7a9ccdb111acc831bcba1d5bf1a0e473ee2dd12114b2f651ba5d3b2c1f5895dc86833200e1248259450aa2c6394c4
7
+ data.tar.gz: d12a7d77b11ad0644d1c65d4aa6b17773d4eef109d1f856af9f590574de7b2b3fd6a2b16d54d05481e4e2afc7f1f365b2403e2b22d44f65df7534508545e858c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.1] - 2025-11-28
4
+
5
+ ### Fixed
6
+
7
+ - Catch `RuntimeError` in addition to `ArgumentError` for enum attribute type errors. Rails 8 raises `RuntimeError` for undeclared enum attributes during schema loading, which was causing the first test run to fail.
8
+
9
+ ## [0.3.0] - 2025-11-18
10
+
11
+ ### Changed
12
+
13
+ - Move ActiveRecord extension inclusion to Railtie initializer for better Rails integration. Sometimes got an error when running tests the first time, but passed on subsequent runs. This will hopefully fix that issue.
14
+
3
15
  ## [0.2.0] - 2025-10-16
4
16
 
5
17
  ### Changed
@@ -44,7 +44,7 @@ module EnumErrorsAway
44
44
  # Call the original enum method
45
45
  begin
46
46
  super(name, values, **options)
47
- rescue ArgumentError => e
47
+ rescue ArgumentError, RuntimeError => e
48
48
  raise e unless e.message.include?('Undeclared attribute type for enum')
49
49
 
50
50
  # Fallback: declare missing attributes and retry
@@ -65,7 +65,3 @@ module EnumErrorsAway
65
65
  end
66
66
  end
67
67
  end
68
-
69
- ActiveSupport.on_load(:active_record) do
70
- ActiveRecord::Base.include(EnumErrorsAway::ActiveRecordExtension)
71
- end
@@ -7,6 +7,7 @@ module EnumErrorsAway
7
7
  initializer 'enum_errors_away.suppress_enum_errors', before: 'active_record.set_configs' do
8
8
  ActiveSupport.on_load(:active_record) do
9
9
  require 'enum_errors_away/active_record_extension'
10
+ ActiveRecord::Base.include(EnumErrorsAway::ActiveRecordExtension)
10
11
  end
11
12
  end
12
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EnumErrorsAway
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum_errors_away
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampo Kuokkanen
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []
148
- rubygems_version: 3.6.9
148
+ rubygems_version: 3.7.2
149
149
  specification_version: 4
150
150
  summary: Fix Rails 7.2+ enum migration failures
151
151
  test_files: []