auto_increment 1.6.0 → 1.6.2
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 +4 -4
- data/Gemfile.lock +4 -2
- data/lib/auto_increment/incrementor.rb +0 -10
- data/lib/auto_increment/version.rb +1 -1
- data/spec/lib/incrementor_spec.rb +0 -19
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 14ed27569367fada694d47fa228d8d0ae3774f5388d01d292ee6bb92548591a2
|
|
4
|
+
data.tar.gz: e360967b97bec3c8cf83b8362319f5b1622c875a7190b82ff74db43fff9983b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90558725fb565ed8dfb589c3b81210a87eb96dae11ee6252bf3fac7e664bdf9c93db378a3096caa97940de6ef5f7c0dd9c92f08f1d36e44d8431524f9de86e23
|
|
7
|
+
data.tar.gz: e53fdeb1c95d043aa34866984c5859297c86bf6f8d66429bd1b18b6daf6b1374d979824c802a1884815df3e613930a0f4ae49853dc072e3f5406a8c0185411e1
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
auto_increment (1.
|
|
4
|
+
auto_increment (1.6.0)
|
|
5
5
|
activerecord (>= 6.0)
|
|
6
6
|
activesupport (>= 6.0)
|
|
7
7
|
|
|
@@ -91,7 +91,8 @@ GEM
|
|
|
91
91
|
rb-inotify (0.10.1)
|
|
92
92
|
ffi (~> 1.0)
|
|
93
93
|
regexp_parser (2.8.3)
|
|
94
|
-
rexml (3.2.
|
|
94
|
+
rexml (3.2.8)
|
|
95
|
+
strscan (>= 3.0.9)
|
|
95
96
|
rspec (3.12.0)
|
|
96
97
|
rspec-core (~> 3.12.0)
|
|
97
98
|
rspec-expectations (~> 3.12.0)
|
|
@@ -125,6 +126,7 @@ GEM
|
|
|
125
126
|
ruby2_keywords (0.0.5)
|
|
126
127
|
shellany (0.0.1)
|
|
127
128
|
sqlite3 (1.4.2)
|
|
129
|
+
strscan (3.1.0)
|
|
128
130
|
terminal-notifier (2.0.0)
|
|
129
131
|
thor (1.3.0)
|
|
130
132
|
timeout (0.4.1)
|
|
@@ -14,8 +14,6 @@ module AutoIncrement
|
|
|
14
14
|
@options = options.reverse_merge initial: 1, force: false
|
|
15
15
|
@options[:scope] = [@options[:scope]].compact unless @options[:scope].is_a?(Array)
|
|
16
16
|
@options[:model_scope] = [@options[:model_scope]].compact unless @options[:model_scope].is_a?(Array)
|
|
17
|
-
|
|
18
|
-
deprecated_warning
|
|
19
17
|
end
|
|
20
18
|
|
|
21
19
|
def before_create(record)
|
|
@@ -78,13 +76,5 @@ module AutoIncrement
|
|
|
78
76
|
def string?
|
|
79
77
|
@options[:initial].instance_of?(String)
|
|
80
78
|
end
|
|
81
|
-
|
|
82
|
-
def deprecated_warning
|
|
83
|
-
return if @options[:scope].empty?
|
|
84
|
-
|
|
85
|
-
ActiveSupport::Deprecation.warn <<~WARNING.squish
|
|
86
|
-
Passing a scope to auto_increment is deprecated and will be removed in the next version. Please use model_scope instead.
|
|
87
|
-
WARNING
|
|
88
|
-
end
|
|
89
79
|
end
|
|
90
80
|
end
|
|
@@ -30,23 +30,4 @@ describe AutoIncrement::Incrementor do
|
|
|
30
30
|
expect(subject.send(:increment)).to eq 'A'
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
|
-
|
|
34
|
-
describe 'deprecates scope' do
|
|
35
|
-
subject { AutoIncrement::Incrementor.new :code, **options }
|
|
36
|
-
let(:options) { { scope: :account_id } }
|
|
37
|
-
|
|
38
|
-
it 'issues a deprecation warning' do
|
|
39
|
-
expect(ActiveSupport::Deprecation).to receive(:warn).with(/Passing a scope to auto_increment is deprecated/)
|
|
40
|
-
subject
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
context 'when @options[:scope] is not present' do
|
|
44
|
-
let(:options) { {} }
|
|
45
|
-
|
|
46
|
-
it 'does not issue a deprecation warning' do
|
|
47
|
-
expect(ActiveSupport::Deprecation).not_to receive(:warn)
|
|
48
|
-
subject
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
33
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: auto_increment
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.
|
|
4
|
+
version: 1.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Felipe Diesel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-05-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
253
253
|
- !ruby/object:Gem::Version
|
|
254
254
|
version: '0'
|
|
255
255
|
requirements: []
|
|
256
|
-
rubygems_version: 3.
|
|
256
|
+
rubygems_version: 3.5.10
|
|
257
257
|
signing_key:
|
|
258
258
|
specification_version: 4
|
|
259
259
|
summary: Auto increment a string or integer column
|