auto_increment 1.6.2 → 1.7.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.
@@ -0,0 +1,182 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ auto_increment (1.7.1)
5
+ activerecord (>= 7.1)
6
+ activesupport (>= 7.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activemodel (7.2.3.1)
12
+ activesupport (= 7.2.3.1)
13
+ activerecord (7.2.3.1)
14
+ activemodel (= 7.2.3.1)
15
+ activesupport (= 7.2.3.1)
16
+ timeout (>= 0.4.0)
17
+ activesupport (7.2.3.1)
18
+ base64
19
+ benchmark (>= 0.3)
20
+ bigdecimal
21
+ concurrent-ruby (~> 1.0, >= 1.3.1)
22
+ connection_pool (>= 2.2.5)
23
+ drb
24
+ i18n (>= 1.6, < 2)
25
+ logger (>= 1.4.2)
26
+ minitest (>= 5.1, < 6)
27
+ securerandom (>= 0.3)
28
+ tzinfo (~> 2.0, >= 2.0.5)
29
+ appraisal (2.5.0)
30
+ bundler
31
+ rake
32
+ thor (>= 0.14.0)
33
+ ast (2.4.3)
34
+ base64 (0.3.0)
35
+ benchmark (0.5.0)
36
+ bigdecimal (4.1.2)
37
+ coderay (1.1.3)
38
+ concurrent-ruby (1.3.7)
39
+ connection_pool (3.0.2)
40
+ database_cleaner (2.1.0)
41
+ database_cleaner-active_record (>= 2, < 3)
42
+ database_cleaner-active_record (2.2.2)
43
+ activerecord (>= 5.a)
44
+ database_cleaner-core (~> 2.0)
45
+ database_cleaner-core (2.1.0)
46
+ diff-lcs (1.6.2)
47
+ drb (2.2.3)
48
+ ffi (1.17.4-arm64-darwin)
49
+ ffi (1.17.4-x86_64-linux-gnu)
50
+ formatador (1.2.3)
51
+ reline
52
+ fuubar (2.5.1)
53
+ rspec-core (~> 3.0)
54
+ ruby-progressbar (~> 1.4)
55
+ guard (2.20.2)
56
+ formatador (>= 0.2.4)
57
+ listen (>= 2.7, < 4.0)
58
+ logger (~> 1.6)
59
+ lumberjack (>= 1.0.12, < 2.0)
60
+ nenv (~> 0.1)
61
+ notiffany (~> 0.0)
62
+ pry (>= 0.13.0)
63
+ shellany (~> 0.0)
64
+ thor (>= 0.18.1)
65
+ guard-compat (1.2.1)
66
+ guard-rspec (4.7.3)
67
+ guard (~> 2.1)
68
+ guard-compat (~> 1.1)
69
+ rspec (>= 2.99.0, < 4.0)
70
+ i18n (1.15.2)
71
+ concurrent-ruby (~> 1.0)
72
+ io-console (0.9.5)
73
+ json (3.1.0)
74
+ language_server-protocol (3.17.0.6)
75
+ lint_roller (1.1.0)
76
+ listen (3.10.1)
77
+ logger
78
+ rb-fsevent (~> 0.10, >= 0.10.3)
79
+ rb-inotify (~> 0.9, >= 0.9.10)
80
+ logger (1.7.0)
81
+ lumberjack (1.4.2)
82
+ method_source (1.1.0)
83
+ minitest (5.27.0)
84
+ nenv (0.3.0)
85
+ notiffany (0.1.3)
86
+ nenv (~> 0.1)
87
+ shellany (~> 0.0)
88
+ parallel (2.3.0)
89
+ parser (3.3.13.0)
90
+ ast (~> 2.4.1)
91
+ racc
92
+ prism (2.1.0-arm64-darwin)
93
+ prism (2.1.0-x86_64-linux-gnu)
94
+ pry (0.16.1)
95
+ coderay (~> 1.1)
96
+ method_source (~> 1.0)
97
+ reline (>= 0.6.0)
98
+ racc (1.8.1)
99
+ rainbow (3.1.1)
100
+ rake (13.4.2)
101
+ rb-fsevent (0.11.2)
102
+ rb-inotify (0.11.1)
103
+ ffi (~> 1.0)
104
+ regexp_parser (2.13.1)
105
+ reline (0.7.0)
106
+ io-console (~> 0.5)
107
+ rspec (3.13.2)
108
+ rspec-core (~> 3.13.0)
109
+ rspec-expectations (~> 3.13.0)
110
+ rspec-mocks (~> 3.13.0)
111
+ rspec-core (3.13.7)
112
+ rspec-support (~> 3.13.0)
113
+ rspec-expectations (3.13.6)
114
+ diff-lcs (>= 1.2.0, < 2.0)
115
+ rspec-support (~> 3.13.0)
116
+ rspec-mocks (3.13.9)
117
+ diff-lcs (>= 1.2.0, < 2.0)
118
+ rspec-support (~> 3.13.0)
119
+ rspec-support (3.13.8)
120
+ rubocop (1.91.0)
121
+ json (>= 2.3)
122
+ language_server-protocol (~> 3.17.0.2)
123
+ lint_roller (~> 1.1.0)
124
+ parallel (>= 1.10)
125
+ parser (>= 3.3.0.2)
126
+ rainbow (>= 2.2.2, < 4.0)
127
+ regexp_parser (>= 2.9.3, < 3.0)
128
+ rubocop-ast (>= 1.49.0, < 2.0)
129
+ ruby-progressbar (~> 1.7)
130
+ unicode-display_width (>= 2.4.0, < 4.0)
131
+ rubocop-ast (1.51.0)
132
+ parser (>= 3.3.7.2)
133
+ prism (>= 1.7)
134
+ rubocop-performance (1.26.1)
135
+ lint_roller (~> 1.1)
136
+ rubocop (>= 1.75.0, < 2.0)
137
+ rubocop-ast (>= 1.47.1, < 2.0)
138
+ ruby-progressbar (1.13.0)
139
+ securerandom (0.4.1)
140
+ shellany (0.0.1)
141
+ sqlite3 (2.10.2-arm64-darwin)
142
+ sqlite3 (2.10.2-x86_64-linux-gnu)
143
+ standard (1.57.0)
144
+ language_server-protocol (~> 3.17.0.2)
145
+ lint_roller (~> 1.0)
146
+ rubocop (~> 1.91.0)
147
+ standard-custom (~> 1.0.0)
148
+ standard-performance (~> 1.8)
149
+ standard-custom (1.0.2)
150
+ lint_roller (~> 1.0)
151
+ rubocop (~> 1.50)
152
+ standard-performance (1.9.0)
153
+ lint_roller (~> 1.1)
154
+ rubocop-performance (~> 1.26.0)
155
+ thor (1.5.0)
156
+ timeout (0.6.1)
157
+ tzinfo (2.0.6)
158
+ concurrent-ruby (~> 1.0)
159
+ unicode-display_width (3.3.0)
160
+ unicode-emoji (~> 4.3)
161
+ unicode-emoji (4.3.0)
162
+
163
+ PLATFORMS
164
+ arm64-darwin-24
165
+ x86_64-linux
166
+
167
+ DEPENDENCIES
168
+ activerecord (= 7.2.3.1)
169
+ activesupport (= 7.2.3.1)
170
+ appraisal
171
+ auto_increment!
172
+ database_cleaner
173
+ fuubar
174
+ guard
175
+ guard-rspec
176
+ rake
177
+ rspec
178
+ sqlite3 (~> 2.10.2)
179
+ standard
180
+
181
+ BUNDLED WITH
182
+ 2.4.22
@@ -0,0 +1,20 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "8.0.5"
6
+ gem "activesupport", "8.0.5"
7
+
8
+ group :development do
9
+ gem "appraisal"
10
+ gem "database_cleaner"
11
+ gem "fuubar"
12
+ gem "guard"
13
+ gem "guard-rspec"
14
+ gem "rake"
15
+ gem "rspec"
16
+ gem "sqlite3", "~> 2.10.2"
17
+ gem "standard"
18
+ end
19
+
20
+ gemspec path: "../"
@@ -0,0 +1,185 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ auto_increment (1.7.1)
5
+ activerecord (>= 7.1)
6
+ activesupport (>= 7.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activemodel (8.0.5)
12
+ activesupport (= 8.0.5)
13
+ activerecord (8.0.5)
14
+ activemodel (= 8.0.5)
15
+ activesupport (= 8.0.5)
16
+ timeout (>= 0.4.0)
17
+ activesupport (8.0.5)
18
+ base64
19
+ benchmark (>= 0.3)
20
+ bigdecimal
21
+ concurrent-ruby (~> 1.0, >= 1.3.1)
22
+ connection_pool (>= 2.2.5)
23
+ drb
24
+ i18n (>= 1.6, < 2)
25
+ logger (>= 1.4.2)
26
+ minitest (>= 5.1)
27
+ securerandom (>= 0.3)
28
+ tzinfo (~> 2.0, >= 2.0.5)
29
+ uri (>= 0.13.1)
30
+ appraisal (2.5.0)
31
+ bundler
32
+ rake
33
+ thor (>= 0.14.0)
34
+ ast (2.4.3)
35
+ base64 (0.3.0)
36
+ benchmark (0.5.0)
37
+ bigdecimal (4.1.2)
38
+ coderay (1.1.3)
39
+ concurrent-ruby (1.3.7)
40
+ connection_pool (3.0.2)
41
+ database_cleaner (2.1.0)
42
+ database_cleaner-active_record (>= 2, < 3)
43
+ database_cleaner-active_record (2.2.2)
44
+ activerecord (>= 5.a)
45
+ database_cleaner-core (~> 2.0)
46
+ database_cleaner-core (2.1.0)
47
+ diff-lcs (1.6.2)
48
+ drb (2.2.3)
49
+ ffi (1.17.4-arm64-darwin)
50
+ ffi (1.17.4-x86_64-linux-gnu)
51
+ formatador (1.2.3)
52
+ reline
53
+ fuubar (2.5.1)
54
+ rspec-core (~> 3.0)
55
+ ruby-progressbar (~> 1.4)
56
+ guard (2.20.2)
57
+ formatador (>= 0.2.4)
58
+ listen (>= 2.7, < 4.0)
59
+ logger (~> 1.6)
60
+ lumberjack (>= 1.0.12, < 2.0)
61
+ nenv (~> 0.1)
62
+ notiffany (~> 0.0)
63
+ pry (>= 0.13.0)
64
+ shellany (~> 0.0)
65
+ thor (>= 0.18.1)
66
+ guard-compat (1.2.1)
67
+ guard-rspec (4.7.3)
68
+ guard (~> 2.1)
69
+ guard-compat (~> 1.1)
70
+ rspec (>= 2.99.0, < 4.0)
71
+ i18n (1.15.2)
72
+ concurrent-ruby (~> 1.0)
73
+ io-console (0.9.5)
74
+ json (3.1.0)
75
+ language_server-protocol (3.17.0.6)
76
+ lint_roller (1.1.0)
77
+ listen (3.10.1)
78
+ logger
79
+ rb-fsevent (~> 0.10, >= 0.10.3)
80
+ rb-inotify (~> 0.9, >= 0.9.10)
81
+ logger (1.7.0)
82
+ lumberjack (1.4.2)
83
+ method_source (1.1.0)
84
+ minitest (6.0.6)
85
+ drb (~> 2.0)
86
+ prism (~> 1.5)
87
+ nenv (0.3.0)
88
+ notiffany (0.1.3)
89
+ nenv (~> 0.1)
90
+ shellany (~> 0.0)
91
+ parallel (2.3.0)
92
+ parser (3.3.13.0)
93
+ ast (~> 2.4.1)
94
+ racc
95
+ prism (1.9.0)
96
+ pry (0.16.1)
97
+ coderay (~> 1.1)
98
+ method_source (~> 1.0)
99
+ reline (>= 0.6.0)
100
+ racc (1.8.1)
101
+ rainbow (3.1.1)
102
+ rake (13.4.2)
103
+ rb-fsevent (0.11.2)
104
+ rb-inotify (0.11.1)
105
+ ffi (~> 1.0)
106
+ regexp_parser (2.13.1)
107
+ reline (0.7.0)
108
+ io-console (~> 0.5)
109
+ rspec (3.13.2)
110
+ rspec-core (~> 3.13.0)
111
+ rspec-expectations (~> 3.13.0)
112
+ rspec-mocks (~> 3.13.0)
113
+ rspec-core (3.13.7)
114
+ rspec-support (~> 3.13.0)
115
+ rspec-expectations (3.13.6)
116
+ diff-lcs (>= 1.2.0, < 2.0)
117
+ rspec-support (~> 3.13.0)
118
+ rspec-mocks (3.13.9)
119
+ diff-lcs (>= 1.2.0, < 2.0)
120
+ rspec-support (~> 3.13.0)
121
+ rspec-support (3.13.8)
122
+ rubocop (1.91.0)
123
+ json (>= 2.3)
124
+ language_server-protocol (~> 3.17.0.2)
125
+ lint_roller (~> 1.1.0)
126
+ parallel (>= 1.10)
127
+ parser (>= 3.3.0.2)
128
+ rainbow (>= 2.2.2, < 4.0)
129
+ regexp_parser (>= 2.9.3, < 3.0)
130
+ rubocop-ast (>= 1.49.0, < 2.0)
131
+ ruby-progressbar (~> 1.7)
132
+ unicode-display_width (>= 2.4.0, < 4.0)
133
+ rubocop-ast (1.51.0)
134
+ parser (>= 3.3.7.2)
135
+ prism (>= 1.7)
136
+ rubocop-performance (1.26.1)
137
+ lint_roller (~> 1.1)
138
+ rubocop (>= 1.75.0, < 2.0)
139
+ rubocop-ast (>= 1.47.1, < 2.0)
140
+ ruby-progressbar (1.13.0)
141
+ securerandom (0.4.1)
142
+ shellany (0.0.1)
143
+ sqlite3 (2.10.2-arm64-darwin)
144
+ sqlite3 (2.10.2-x86_64-linux-gnu)
145
+ standard (1.57.0)
146
+ language_server-protocol (~> 3.17.0.2)
147
+ lint_roller (~> 1.0)
148
+ rubocop (~> 1.91.0)
149
+ standard-custom (~> 1.0.0)
150
+ standard-performance (~> 1.8)
151
+ standard-custom (1.0.2)
152
+ lint_roller (~> 1.0)
153
+ rubocop (~> 1.50)
154
+ standard-performance (1.9.0)
155
+ lint_roller (~> 1.1)
156
+ rubocop-performance (~> 1.26.0)
157
+ thor (1.5.0)
158
+ timeout (0.6.1)
159
+ tzinfo (2.0.6)
160
+ concurrent-ruby (~> 1.0)
161
+ unicode-display_width (3.3.0)
162
+ unicode-emoji (~> 4.3)
163
+ unicode-emoji (4.3.0)
164
+ uri (1.1.1)
165
+
166
+ PLATFORMS
167
+ arm64-darwin-24
168
+ x86_64-linux
169
+
170
+ DEPENDENCIES
171
+ activerecord (= 8.0.5)
172
+ activesupport (= 8.0.5)
173
+ appraisal
174
+ auto_increment!
175
+ database_cleaner
176
+ fuubar
177
+ guard
178
+ guard-rspec
179
+ rake
180
+ rspec
181
+ sqlite3 (~> 2.10.2)
182
+ standard
183
+
184
+ BUNDLED WITH
185
+ 2.4.22
@@ -0,0 +1,20 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "8.1.3"
6
+ gem "activesupport", "8.1.3"
7
+
8
+ group :development do
9
+ gem "appraisal"
10
+ gem "database_cleaner"
11
+ gem "fuubar"
12
+ gem "guard"
13
+ gem "guard-rspec"
14
+ gem "rake"
15
+ gem "rspec"
16
+ gem "sqlite3", "~> 2.10.2"
17
+ gem "standard"
18
+ end
19
+
20
+ gemspec path: "../"
@@ -0,0 +1,184 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ auto_increment (1.7.1)
5
+ activerecord (>= 7.1)
6
+ activesupport (>= 7.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activemodel (8.1.3)
12
+ activesupport (= 8.1.3)
13
+ activerecord (8.1.3)
14
+ activemodel (= 8.1.3)
15
+ activesupport (= 8.1.3)
16
+ timeout (>= 0.4.0)
17
+ activesupport (8.1.3)
18
+ base64
19
+ bigdecimal
20
+ concurrent-ruby (~> 1.0, >= 1.3.1)
21
+ connection_pool (>= 2.2.5)
22
+ drb
23
+ i18n (>= 1.6, < 2)
24
+ json
25
+ logger (>= 1.4.2)
26
+ minitest (>= 5.1)
27
+ securerandom (>= 0.3)
28
+ tzinfo (~> 2.0, >= 2.0.5)
29
+ uri (>= 0.13.1)
30
+ appraisal (2.5.0)
31
+ bundler
32
+ rake
33
+ thor (>= 0.14.0)
34
+ ast (2.4.3)
35
+ base64 (0.3.0)
36
+ bigdecimal (4.1.2)
37
+ coderay (1.1.3)
38
+ concurrent-ruby (1.3.7)
39
+ connection_pool (3.0.2)
40
+ database_cleaner (2.1.0)
41
+ database_cleaner-active_record (>= 2, < 3)
42
+ database_cleaner-active_record (2.2.2)
43
+ activerecord (>= 5.a)
44
+ database_cleaner-core (~> 2.0)
45
+ database_cleaner-core (2.1.0)
46
+ diff-lcs (1.6.2)
47
+ drb (2.2.3)
48
+ ffi (1.17.4-arm64-darwin)
49
+ ffi (1.17.4-x86_64-linux-gnu)
50
+ formatador (1.2.3)
51
+ reline
52
+ fuubar (2.5.1)
53
+ rspec-core (~> 3.0)
54
+ ruby-progressbar (~> 1.4)
55
+ guard (2.20.2)
56
+ formatador (>= 0.2.4)
57
+ listen (>= 2.7, < 4.0)
58
+ logger (~> 1.6)
59
+ lumberjack (>= 1.0.12, < 2.0)
60
+ nenv (~> 0.1)
61
+ notiffany (~> 0.0)
62
+ pry (>= 0.13.0)
63
+ shellany (~> 0.0)
64
+ thor (>= 0.18.1)
65
+ guard-compat (1.2.1)
66
+ guard-rspec (4.7.3)
67
+ guard (~> 2.1)
68
+ guard-compat (~> 1.1)
69
+ rspec (>= 2.99.0, < 4.0)
70
+ i18n (1.15.2)
71
+ concurrent-ruby (~> 1.0)
72
+ io-console (0.9.5)
73
+ json (3.1.0)
74
+ language_server-protocol (3.17.0.6)
75
+ lint_roller (1.1.0)
76
+ listen (3.10.1)
77
+ logger
78
+ rb-fsevent (~> 0.10, >= 0.10.3)
79
+ rb-inotify (~> 0.9, >= 0.9.10)
80
+ logger (1.7.0)
81
+ lumberjack (1.4.2)
82
+ method_source (1.1.0)
83
+ minitest (6.0.6)
84
+ drb (~> 2.0)
85
+ prism (~> 1.5)
86
+ nenv (0.3.0)
87
+ notiffany (0.1.3)
88
+ nenv (~> 0.1)
89
+ shellany (~> 0.0)
90
+ parallel (2.3.0)
91
+ parser (3.3.13.0)
92
+ ast (~> 2.4.1)
93
+ racc
94
+ prism (1.9.0)
95
+ pry (0.16.1)
96
+ coderay (~> 1.1)
97
+ method_source (~> 1.0)
98
+ reline (>= 0.6.0)
99
+ racc (1.8.1)
100
+ rainbow (3.1.1)
101
+ rake (13.4.2)
102
+ rb-fsevent (0.11.2)
103
+ rb-inotify (0.11.1)
104
+ ffi (~> 1.0)
105
+ regexp_parser (2.13.1)
106
+ reline (0.7.0)
107
+ io-console (~> 0.5)
108
+ rspec (3.13.2)
109
+ rspec-core (~> 3.13.0)
110
+ rspec-expectations (~> 3.13.0)
111
+ rspec-mocks (~> 3.13.0)
112
+ rspec-core (3.13.7)
113
+ rspec-support (~> 3.13.0)
114
+ rspec-expectations (3.13.6)
115
+ diff-lcs (>= 1.2.0, < 2.0)
116
+ rspec-support (~> 3.13.0)
117
+ rspec-mocks (3.13.9)
118
+ diff-lcs (>= 1.2.0, < 2.0)
119
+ rspec-support (~> 3.13.0)
120
+ rspec-support (3.13.8)
121
+ rubocop (1.91.0)
122
+ json (>= 2.3)
123
+ language_server-protocol (~> 3.17.0.2)
124
+ lint_roller (~> 1.1.0)
125
+ parallel (>= 1.10)
126
+ parser (>= 3.3.0.2)
127
+ rainbow (>= 2.2.2, < 4.0)
128
+ regexp_parser (>= 2.9.3, < 3.0)
129
+ rubocop-ast (>= 1.49.0, < 2.0)
130
+ ruby-progressbar (~> 1.7)
131
+ unicode-display_width (>= 2.4.0, < 4.0)
132
+ rubocop-ast (1.51.0)
133
+ parser (>= 3.3.7.2)
134
+ prism (>= 1.7)
135
+ rubocop-performance (1.26.1)
136
+ lint_roller (~> 1.1)
137
+ rubocop (>= 1.75.0, < 2.0)
138
+ rubocop-ast (>= 1.47.1, < 2.0)
139
+ ruby-progressbar (1.13.0)
140
+ securerandom (0.4.1)
141
+ shellany (0.0.1)
142
+ sqlite3 (2.10.2-arm64-darwin)
143
+ sqlite3 (2.10.2-x86_64-linux-gnu)
144
+ standard (1.57.0)
145
+ language_server-protocol (~> 3.17.0.2)
146
+ lint_roller (~> 1.0)
147
+ rubocop (~> 1.91.0)
148
+ standard-custom (~> 1.0.0)
149
+ standard-performance (~> 1.8)
150
+ standard-custom (1.0.2)
151
+ lint_roller (~> 1.0)
152
+ rubocop (~> 1.50)
153
+ standard-performance (1.9.0)
154
+ lint_roller (~> 1.1)
155
+ rubocop-performance (~> 1.26.0)
156
+ thor (1.5.0)
157
+ timeout (0.6.1)
158
+ tzinfo (2.0.6)
159
+ concurrent-ruby (~> 1.0)
160
+ unicode-display_width (3.3.0)
161
+ unicode-emoji (~> 4.3)
162
+ unicode-emoji (4.3.0)
163
+ uri (1.1.1)
164
+
165
+ PLATFORMS
166
+ arm64-darwin-24
167
+ x86_64-linux
168
+
169
+ DEPENDENCIES
170
+ activerecord (= 8.1.3)
171
+ activesupport (= 8.1.3)
172
+ appraisal
173
+ auto_increment!
174
+ database_cleaner
175
+ fuubar
176
+ guard
177
+ guard-rspec
178
+ rake
179
+ rspec
180
+ sqlite3 (~> 2.10.2)
181
+ standard
182
+
183
+ BUNDLED WITH
184
+ 2.4.22
@@ -5,14 +5,41 @@ module AutoIncrement
5
5
  # +AutoIncrement::ActiveRecord+
6
6
  module ActiveRecord
7
7
  extend ActiveSupport::Concern
8
+
8
9
  # +AutoIncrement::ActiveRecord::ClassMethods+
9
10
  module ClassMethods
10
- def auto_increment(column = nil, options = {})
11
- options.reverse_merge! before: :create
11
+ def auto_increment(column = nil, **options)
12
+ column ||= options.fetch(:column, :code)
13
+
14
+ auto_increment_deprecate_type_mismatch(column, options[:initial]) if options.key?(:initial)
15
+
16
+ send("before_#{options.fetch(:before, :create)}") do |record|
17
+ Incrementor.new(record, column, **options).run
18
+ end
19
+ end
20
+
21
+ private
22
+
23
+ def auto_increment_deprecate_type_mismatch(column, initial)
24
+ col = begin
25
+ columns_hash[column.to_s]
26
+ rescue ActiveRecord::ConnectionNotEstablished, ActiveRecord::NoDatabaseError
27
+ # Ignore connection/schema errors during class loading
28
+ return
29
+ end
30
+ return unless col
31
+
32
+ col_type = col.type
33
+ return if col_type == :integer && initial.is_a?(Integer)
34
+ return if col_type.in?(%i[string text]) && initial.is_a?(String)
12
35
 
13
- callback = "before_#{options[:before]}"
36
+ model_name = name.presence || "anonymous"
14
37
 
15
- send callback, Incrementor.new(column, options)
38
+ warn(
39
+ "[DEPRECATION] The initial value type (#{initial.class}) does not match " \
40
+ "the column type (#{col_type}) for column '#{column}' on #{model_name}. " \
41
+ "This behavior is deprecated and will raise an error in the future."
42
+ )
16
43
  end
17
44
  end
18
45
  end