seed-do 3.0.2 → 3.1.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.
- checksums.yaml +4 -4
- data/lib/seed-do/seeder.rb +2 -9
- data/lib/seed-do/version.rb +1 -1
- 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: a144ca5bdde78bd698bd63b5b7ec5d4538e290d494d6d9feaf3b72c2fabc94bd
|
|
4
|
+
data.tar.gz: 05156a89c384563da57269b0850fc21f89b6d3f87fdb1801d83b5743cc286d22
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 22803ec0568fbfe2d89b20cd65f04c331da02673b901724e7fcd48d22c8b764eff73763c14cd197292e9408f7345fe562a4c1ee5b329f3c8e926b7a25413e166
|
|
7
|
+
data.tar.gz: '006481304627db4be5b6eb2ebba80c043078b78c1b4e815a9323398a7aa9f7b395ca3971cb0069f942413a957637f8cf839f71c479ebb9feaa8cf6f7b915ba83'
|
data/lib/seed-do/seeder.rb
CHANGED
|
@@ -64,13 +64,7 @@ module SeedDo
|
|
|
64
64
|
|
|
65
65
|
puts " - #{@model_class} #{data.inspect}" unless @options[:quiet]
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
if record.class.respond_to?(:protected_attributes) && record.class.respond_to?(:accessible_attributes)
|
|
69
|
-
record.assign_attributes(data, :without_protection => true)
|
|
70
|
-
# Rails 4 without rails/protected_attributes
|
|
71
|
-
else
|
|
72
|
-
record.assign_attributes(data)
|
|
73
|
-
end
|
|
67
|
+
record.assign_attributes(data)
|
|
74
68
|
record.save(:validate => false) || raise(ActiveRecord::RecordNotSaved, 'Record not saved!')
|
|
75
69
|
record
|
|
76
70
|
end
|
|
@@ -91,8 +85,7 @@ module SeedDo
|
|
|
91
85
|
quoted_id = @model_class.connection.quote_column_name(@model_class.primary_key)
|
|
92
86
|
sequence = @model_class.sequence_name
|
|
93
87
|
|
|
94
|
-
|
|
95
|
-
if @model_class.connection.send(:postgresql_version) >= 100000
|
|
88
|
+
if @model_class.connection.postgresql_version >= 100000
|
|
96
89
|
sql =<<-EOS
|
|
97
90
|
SELECT setval('#{sequence}', (SELECT GREATEST(MAX(#{quoted_id})+(SELECT seqincrement FROM pg_sequence WHERE seqrelid = '#{sequence}'::regclass), (SELECT seqmin FROM pg_sequence WHERE seqrelid = '#{sequence}'::regclass)) FROM #{@model_class.quoted_table_name}), false)
|
|
98
91
|
EOS
|
data/lib/seed-do/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: seed-do
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shinichi Maeshima
|
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
94
|
version: '0'
|
|
95
95
|
requirements: []
|
|
96
|
-
rubygems_version: 3.6.
|
|
96
|
+
rubygems_version: 3.6.9
|
|
97
97
|
specification_version: 4
|
|
98
98
|
summary: Easily manage seed data in your Active Record application
|
|
99
99
|
test_files: []
|