nexus_seed 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nexus_seed/base.rb +9 -0
- data/lib/nexus_seed/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d134ad4feaf2732ab78c1eb4e452d3e152e05091a6d34050e29b3d72738c919
|
4
|
+
data.tar.gz: 5679c7a3a40e6fdbac4d51d2581150f0ddb84766d587d94aeb3c4f42c8698207
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ad6d44c43624ab30210f185cd1aa635f9fb864cb751409e2b5a1e851a57dc0220adef961fdf206d96bdbd8854dece8fb545cf4f426949fdbcaf1781ecacc905
|
7
|
+
data.tar.gz: 826f3d7549df7df94a73679500e9a937ab5a8623737327df651c7a17329a96b5a37a2bc53f8efff4693cadf9ce14a8b08a19c26a53a19e5e1c5b3ee4b3764173
|
data/lib/nexus_seed/base.rb
CHANGED
@@ -9,6 +9,15 @@ module NexusSeed
|
|
9
9
|
if ENV['destroy_seeds']
|
10
10
|
NexusSeed::Builder.destroy_seeds
|
11
11
|
end
|
12
|
+
|
13
|
+
# Reset table sequences. Apparently rails looses track of a pk sequence if the pk value is inserted manually, e.g
|
14
|
+
# User.new(id: 1).save. When subsequently running User.create(), ActiveRecord should increment the id value to 2
|
15
|
+
# by default, but turns out it will try to insert id: 1 again which will result in an error.
|
16
|
+
#
|
17
|
+
# @todo This "fix" is not ideal and will require more investigation.
|
18
|
+
ActiveRecord::Base.connection.tables.each do |t|
|
19
|
+
ActiveRecord::Base.connection.reset_pk_sequence!(t)
|
20
|
+
end
|
12
21
|
end
|
13
22
|
end
|
14
23
|
end
|
data/lib/nexus_seed/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexus_seed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johnathon Harris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nexus_semantic_logger
|