auto_increment 1.6.1 → 1.7.0

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,187 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ auto_increment (1.7.0)
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.1)
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.8.2)
73
+ json (2.20.0)
74
+ language_server-protocol (3.17.0.5)
75
+ lint_roller (1.1.0)
76
+ listen (3.10.0)
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.1.0)
89
+ parser (3.3.11.1)
90
+ ast (~> 2.4.1)
91
+ racc
92
+ prism (1.9.0)
93
+ pry (0.16.0)
94
+ coderay (~> 1.1)
95
+ method_source (~> 1.0)
96
+ reline (>= 0.6.0)
97
+ racc (1.8.1)
98
+ rainbow (3.1.1)
99
+ rake (13.4.2)
100
+ rb-fsevent (0.11.2)
101
+ rb-inotify (0.11.1)
102
+ ffi (~> 1.0)
103
+ regexp_parser (2.12.0)
104
+ reline (0.6.3)
105
+ io-console (~> 0.5)
106
+ rspec (3.13.2)
107
+ rspec-core (~> 3.13.0)
108
+ rspec-expectations (~> 3.13.0)
109
+ rspec-mocks (~> 3.13.0)
110
+ rspec-core (3.13.6)
111
+ rspec-support (~> 3.13.0)
112
+ rspec-expectations (3.13.5)
113
+ diff-lcs (>= 1.2.0, < 2.0)
114
+ rspec-support (~> 3.13.0)
115
+ rspec-mocks (3.13.8)
116
+ diff-lcs (>= 1.2.0, < 2.0)
117
+ rspec-support (~> 3.13.0)
118
+ rspec-nc (0.3.0)
119
+ rspec (>= 3)
120
+ terminal-notifier (>= 1.4)
121
+ rspec-support (3.13.7)
122
+ rubocop (1.87.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.49.1)
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.9.5-arm64-darwin)
144
+ sqlite3 (2.9.5-x86_64-linux-gnu)
145
+ standard (1.55.0)
146
+ language_server-protocol (~> 3.17.0.2)
147
+ lint_roller (~> 1.0)
148
+ rubocop (~> 1.87.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
+ terminal-notifier (2.0.0)
158
+ thor (1.5.0)
159
+ timeout (0.6.1)
160
+ tzinfo (2.0.6)
161
+ concurrent-ruby (~> 1.0)
162
+ unicode-display_width (3.2.0)
163
+ unicode-emoji (~> 4.1)
164
+ unicode-emoji (4.2.0)
165
+
166
+ PLATFORMS
167
+ arm64-darwin-24
168
+ x86_64-linux
169
+
170
+ DEPENDENCIES
171
+ activerecord (= 7.2.3.1)
172
+ activesupport (= 7.2.3.1)
173
+ appraisal
174
+ auto_increment!
175
+ bundler
176
+ database_cleaner
177
+ fuubar
178
+ guard
179
+ guard-rspec
180
+ rake
181
+ rspec
182
+ rspec-nc
183
+ sqlite3 (~> 2.9.5)
184
+ standard
185
+
186
+ BUNDLED WITH
187
+ 2.4.22
@@ -0,0 +1,22 @@
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 "bundler"
11
+ gem "database_cleaner"
12
+ gem "fuubar"
13
+ gem "guard"
14
+ gem "guard-rspec"
15
+ gem "rake"
16
+ gem "rspec"
17
+ gem "rspec-nc"
18
+ gem "sqlite3", "~> 2.9.5"
19
+ gem "standard"
20
+ end
21
+
22
+ gemspec path: "../"
@@ -0,0 +1,191 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ auto_increment (1.7.0)
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.1)
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.8.2)
74
+ json (2.20.0)
75
+ language_server-protocol (3.17.0.5)
76
+ lint_roller (1.1.0)
77
+ listen (3.10.0)
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.1.0)
92
+ parser (3.3.11.1)
93
+ ast (~> 2.4.1)
94
+ racc
95
+ prism (1.9.0)
96
+ pry (0.16.0)
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.12.0)
107
+ reline (0.6.3)
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.6)
114
+ rspec-support (~> 3.13.0)
115
+ rspec-expectations (3.13.5)
116
+ diff-lcs (>= 1.2.0, < 2.0)
117
+ rspec-support (~> 3.13.0)
118
+ rspec-mocks (3.13.8)
119
+ diff-lcs (>= 1.2.0, < 2.0)
120
+ rspec-support (~> 3.13.0)
121
+ rspec-nc (0.3.0)
122
+ rspec (>= 3)
123
+ terminal-notifier (>= 1.4)
124
+ rspec-support (3.13.7)
125
+ rubocop (1.87.0)
126
+ json (~> 2.3)
127
+ language_server-protocol (~> 3.17.0.2)
128
+ lint_roller (~> 1.1.0)
129
+ parallel (>= 1.10)
130
+ parser (>= 3.3.0.2)
131
+ rainbow (>= 2.2.2, < 4.0)
132
+ regexp_parser (>= 2.9.3, < 3.0)
133
+ rubocop-ast (>= 1.49.0, < 2.0)
134
+ ruby-progressbar (~> 1.7)
135
+ unicode-display_width (>= 2.4.0, < 4.0)
136
+ rubocop-ast (1.49.1)
137
+ parser (>= 3.3.7.2)
138
+ prism (~> 1.7)
139
+ rubocop-performance (1.26.1)
140
+ lint_roller (~> 1.1)
141
+ rubocop (>= 1.75.0, < 2.0)
142
+ rubocop-ast (>= 1.47.1, < 2.0)
143
+ ruby-progressbar (1.13.0)
144
+ securerandom (0.4.1)
145
+ shellany (0.0.1)
146
+ sqlite3 (2.9.5-arm64-darwin)
147
+ sqlite3 (2.9.5-x86_64-linux-gnu)
148
+ standard (1.55.0)
149
+ language_server-protocol (~> 3.17.0.2)
150
+ lint_roller (~> 1.0)
151
+ rubocop (~> 1.87.0)
152
+ standard-custom (~> 1.0.0)
153
+ standard-performance (~> 1.8)
154
+ standard-custom (1.0.2)
155
+ lint_roller (~> 1.0)
156
+ rubocop (~> 1.50)
157
+ standard-performance (1.9.0)
158
+ lint_roller (~> 1.1)
159
+ rubocop-performance (~> 1.26.0)
160
+ terminal-notifier (2.0.0)
161
+ thor (1.5.0)
162
+ timeout (0.6.1)
163
+ tzinfo (2.0.6)
164
+ concurrent-ruby (~> 1.0)
165
+ unicode-display_width (3.2.0)
166
+ unicode-emoji (~> 4.1)
167
+ unicode-emoji (4.2.0)
168
+ uri (1.1.1)
169
+
170
+ PLATFORMS
171
+ arm64-darwin-24
172
+ x86_64-linux
173
+
174
+ DEPENDENCIES
175
+ activerecord (= 8.0.5)
176
+ activesupport (= 8.0.5)
177
+ appraisal
178
+ auto_increment!
179
+ bundler
180
+ database_cleaner
181
+ fuubar
182
+ guard
183
+ guard-rspec
184
+ rake
185
+ rspec
186
+ rspec-nc
187
+ sqlite3 (~> 2.9.5)
188
+ standard
189
+
190
+ BUNDLED WITH
191
+ 2.4.22
@@ -0,0 +1,22 @@
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 "bundler"
11
+ gem "database_cleaner"
12
+ gem "fuubar"
13
+ gem "guard"
14
+ gem "guard-rspec"
15
+ gem "rake"
16
+ gem "rspec"
17
+ gem "rspec-nc"
18
+ gem "sqlite3", "~> 2.9.5"
19
+ gem "standard"
20
+ end
21
+
22
+ gemspec path: "../"
@@ -0,0 +1,190 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ auto_increment (1.7.0)
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.1)
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.8.2)
73
+ json (2.20.0)
74
+ language_server-protocol (3.17.0.5)
75
+ lint_roller (1.1.0)
76
+ listen (3.10.0)
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.1.0)
91
+ parser (3.3.11.1)
92
+ ast (~> 2.4.1)
93
+ racc
94
+ prism (1.9.0)
95
+ pry (0.16.0)
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.12.0)
106
+ reline (0.6.3)
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.6)
113
+ rspec-support (~> 3.13.0)
114
+ rspec-expectations (3.13.5)
115
+ diff-lcs (>= 1.2.0, < 2.0)
116
+ rspec-support (~> 3.13.0)
117
+ rspec-mocks (3.13.8)
118
+ diff-lcs (>= 1.2.0, < 2.0)
119
+ rspec-support (~> 3.13.0)
120
+ rspec-nc (0.3.0)
121
+ rspec (>= 3)
122
+ terminal-notifier (>= 1.4)
123
+ rspec-support (3.13.7)
124
+ rubocop (1.87.0)
125
+ json (~> 2.3)
126
+ language_server-protocol (~> 3.17.0.2)
127
+ lint_roller (~> 1.1.0)
128
+ parallel (>= 1.10)
129
+ parser (>= 3.3.0.2)
130
+ rainbow (>= 2.2.2, < 4.0)
131
+ regexp_parser (>= 2.9.3, < 3.0)
132
+ rubocop-ast (>= 1.49.0, < 2.0)
133
+ ruby-progressbar (~> 1.7)
134
+ unicode-display_width (>= 2.4.0, < 4.0)
135
+ rubocop-ast (1.49.1)
136
+ parser (>= 3.3.7.2)
137
+ prism (~> 1.7)
138
+ rubocop-performance (1.26.1)
139
+ lint_roller (~> 1.1)
140
+ rubocop (>= 1.75.0, < 2.0)
141
+ rubocop-ast (>= 1.47.1, < 2.0)
142
+ ruby-progressbar (1.13.0)
143
+ securerandom (0.4.1)
144
+ shellany (0.0.1)
145
+ sqlite3 (2.9.5-arm64-darwin)
146
+ sqlite3 (2.9.5-x86_64-linux-gnu)
147
+ standard (1.55.0)
148
+ language_server-protocol (~> 3.17.0.2)
149
+ lint_roller (~> 1.0)
150
+ rubocop (~> 1.87.0)
151
+ standard-custom (~> 1.0.0)
152
+ standard-performance (~> 1.8)
153
+ standard-custom (1.0.2)
154
+ lint_roller (~> 1.0)
155
+ rubocop (~> 1.50)
156
+ standard-performance (1.9.0)
157
+ lint_roller (~> 1.1)
158
+ rubocop-performance (~> 1.26.0)
159
+ terminal-notifier (2.0.0)
160
+ thor (1.5.0)
161
+ timeout (0.6.1)
162
+ tzinfo (2.0.6)
163
+ concurrent-ruby (~> 1.0)
164
+ unicode-display_width (3.2.0)
165
+ unicode-emoji (~> 4.1)
166
+ unicode-emoji (4.2.0)
167
+ uri (1.1.1)
168
+
169
+ PLATFORMS
170
+ arm64-darwin-24
171
+ x86_64-linux
172
+
173
+ DEPENDENCIES
174
+ activerecord (= 8.1.3)
175
+ activesupport (= 8.1.3)
176
+ appraisal
177
+ auto_increment!
178
+ bundler
179
+ database_cleaner
180
+ fuubar
181
+ guard
182
+ guard-rspec
183
+ rake
184
+ rspec
185
+ rspec-nc
186
+ sqlite3 (~> 2.9.5)
187
+ standard
188
+
189
+ BUNDLED WITH
190
+ 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