activerecord-import 1.0.2 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yaml +151 -0
  3. data/.gitignore +5 -0
  4. data/.rubocop.yml +74 -8
  5. data/.rubocop_todo.yml +10 -16
  6. data/Brewfile +3 -1
  7. data/CHANGELOG.md +138 -3
  8. data/Dockerfile +23 -0
  9. data/Gemfile +24 -14
  10. data/LICENSE +21 -56
  11. data/README.markdown +108 -60
  12. data/Rakefile +3 -0
  13. data/activerecord-import.gemspec +6 -5
  14. data/benchmarks/benchmark.rb +10 -4
  15. data/benchmarks/lib/base.rb +4 -2
  16. data/benchmarks/lib/cli_parser.rb +4 -2
  17. data/benchmarks/lib/float.rb +2 -0
  18. data/benchmarks/lib/mysql2_benchmark.rb +2 -0
  19. data/benchmarks/lib/output_to_csv.rb +2 -0
  20. data/benchmarks/lib/output_to_html.rb +4 -2
  21. data/benchmarks/models/test_innodb.rb +2 -0
  22. data/benchmarks/models/test_memory.rb +2 -0
  23. data/benchmarks/models/test_myisam.rb +2 -0
  24. data/benchmarks/schema/{mysql_schema.rb → mysql2_schema.rb} +2 -0
  25. data/docker-compose.yml +34 -0
  26. data/gemfiles/4.2.gemfile +2 -0
  27. data/gemfiles/5.0.gemfile +2 -0
  28. data/gemfiles/5.1.gemfile +2 -0
  29. data/gemfiles/5.2.gemfile +2 -0
  30. data/gemfiles/6.0.gemfile +4 -1
  31. data/gemfiles/6.1.gemfile +4 -1
  32. data/gemfiles/7.0.gemfile +4 -0
  33. data/gemfiles/7.1.gemfile +3 -0
  34. data/lib/activerecord-import/active_record/adapters/abstract_adapter.rb +2 -0
  35. data/lib/activerecord-import/active_record/adapters/jdbcmysql_adapter.rb +6 -4
  36. data/lib/activerecord-import/active_record/adapters/jdbcpostgresql_adapter.rb +2 -0
  37. data/lib/activerecord-import/active_record/adapters/jdbcsqlite3_adapter.rb +2 -0
  38. data/lib/activerecord-import/active_record/adapters/mysql2_adapter.rb +2 -0
  39. data/lib/activerecord-import/active_record/adapters/postgresql_adapter.rb +2 -0
  40. data/lib/activerecord-import/active_record/adapters/seamless_database_pool_adapter.rb +2 -0
  41. data/lib/activerecord-import/active_record/adapters/sqlite3_adapter.rb +2 -0
  42. data/lib/activerecord-import/active_record/adapters/trilogy_adapter.rb +8 -0
  43. data/lib/activerecord-import/adapters/abstract_adapter.rb +14 -5
  44. data/lib/activerecord-import/adapters/em_mysql2_adapter.rb +2 -0
  45. data/lib/activerecord-import/adapters/mysql2_adapter.rb +2 -0
  46. data/lib/activerecord-import/adapters/mysql_adapter.rb +33 -25
  47. data/lib/activerecord-import/adapters/postgresql_adapter.rb +69 -56
  48. data/lib/activerecord-import/adapters/sqlite3_adapter.rb +39 -39
  49. data/lib/activerecord-import/adapters/trilogy_adapter.rb +7 -0
  50. data/lib/activerecord-import/base.rb +10 -2
  51. data/lib/activerecord-import/import.rb +162 -65
  52. data/lib/activerecord-import/mysql2.rb +2 -0
  53. data/lib/activerecord-import/postgresql.rb +2 -0
  54. data/lib/activerecord-import/sqlite3.rb +2 -0
  55. data/lib/activerecord-import/synchronize.rb +3 -1
  56. data/lib/activerecord-import/value_sets_parser.rb +5 -0
  57. data/lib/activerecord-import/version.rb +3 -1
  58. data/lib/activerecord-import.rb +2 -1
  59. data/test/adapters/jdbcmysql.rb +2 -0
  60. data/test/adapters/jdbcpostgresql.rb +2 -0
  61. data/test/adapters/jdbcsqlite3.rb +2 -0
  62. data/test/adapters/makara_postgis.rb +2 -0
  63. data/test/adapters/mysql2.rb +2 -0
  64. data/test/adapters/mysql2_makara.rb +2 -0
  65. data/test/adapters/mysql2spatial.rb +2 -0
  66. data/test/adapters/postgis.rb +2 -0
  67. data/test/adapters/postgresql.rb +2 -0
  68. data/test/adapters/postgresql_makara.rb +2 -0
  69. data/test/adapters/seamless_database_pool.rb +2 -0
  70. data/test/adapters/spatialite.rb +2 -0
  71. data/test/adapters/sqlite3.rb +2 -0
  72. data/test/adapters/trilogy.rb +9 -0
  73. data/test/database.yml.sample +7 -0
  74. data/test/{travis → github}/database.yml +7 -1
  75. data/test/import_test.rb +93 -2
  76. data/test/jdbcmysql/import_test.rb +5 -3
  77. data/test/jdbcpostgresql/import_test.rb +4 -2
  78. data/test/jdbcsqlite3/import_test.rb +4 -2
  79. data/test/makara_postgis/import_test.rb +4 -2
  80. data/test/models/account.rb +2 -0
  81. data/test/models/alarm.rb +2 -0
  82. data/test/models/animal.rb +8 -0
  83. data/test/models/author.rb +7 -0
  84. data/test/models/bike_maker.rb +3 -0
  85. data/test/models/book.rb +7 -2
  86. data/test/models/car.rb +2 -0
  87. data/test/models/card.rb +5 -0
  88. data/test/models/chapter.rb +2 -0
  89. data/test/models/composite_book.rb +19 -0
  90. data/test/models/composite_chapter.rb +9 -0
  91. data/test/models/customer.rb +18 -0
  92. data/test/models/deck.rb +8 -0
  93. data/test/models/dictionary.rb +2 -0
  94. data/test/models/discount.rb +2 -0
  95. data/test/models/end_note.rb +2 -0
  96. data/test/models/group.rb +2 -0
  97. data/test/models/order.rb +17 -0
  98. data/test/models/playing_card.rb +4 -0
  99. data/test/models/promotion.rb +2 -0
  100. data/test/models/question.rb +2 -0
  101. data/test/models/rule.rb +2 -0
  102. data/test/models/tag.rb +9 -1
  103. data/test/models/tag_alias.rb +11 -0
  104. data/test/models/topic.rb +7 -0
  105. data/test/models/user.rb +2 -0
  106. data/test/models/user_token.rb +2 -0
  107. data/test/models/vendor.rb +2 -0
  108. data/test/models/widget.rb +2 -0
  109. data/test/mysql2/import_test.rb +5 -3
  110. data/test/mysql2_makara/import_test.rb +5 -3
  111. data/test/mysqlspatial2/import_test.rb +5 -3
  112. data/test/postgis/import_test.rb +4 -2
  113. data/test/postgresql/import_test.rb +4 -2
  114. data/test/schema/generic_schema.rb +37 -1
  115. data/test/schema/jdbcpostgresql_schema.rb +3 -1
  116. data/test/schema/mysql2_schema.rb +2 -0
  117. data/test/schema/postgis_schema.rb +3 -1
  118. data/test/schema/postgresql_schema.rb +47 -0
  119. data/test/schema/sqlite3_schema.rb +2 -0
  120. data/test/schema/version.rb +2 -0
  121. data/test/sqlite3/import_test.rb +4 -2
  122. data/test/support/active_support/test_case_extensions.rb +2 -0
  123. data/test/support/assertions.rb +2 -0
  124. data/test/support/factories.rb +2 -0
  125. data/test/support/generate.rb +4 -2
  126. data/test/support/mysql/import_examples.rb +2 -1
  127. data/test/support/postgresql/import_examples.rb +108 -2
  128. data/test/support/shared_examples/on_duplicate_key_ignore.rb +2 -0
  129. data/test/support/shared_examples/on_duplicate_key_update.rb +78 -9
  130. data/test/support/shared_examples/recursive_import.rb +98 -1
  131. data/test/support/sqlite3/import_examples.rb +2 -1
  132. data/test/synchronize_test.rb +2 -0
  133. data/test/test_helper.rb +33 -6
  134. data/test/trilogy/import_test.rb +7 -0
  135. data/test/value_sets_bytes_parser_test.rb +3 -1
  136. data/test/value_sets_records_parser_test.rb +3 -1
  137. metadata +42 -16
  138. data/.travis.yml +0 -70
  139. data/gemfiles/3.2.gemfile +0 -2
  140. data/gemfiles/4.0.gemfile +0 -2
  141. data/gemfiles/4.1.gemfile +0 -2
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  def should_support_recursive_import
2
4
  describe "importing objects with associations" do
3
5
  let(:new_topics) { Build(num_topics, :topic_with_book) }
@@ -138,6 +140,15 @@ def should_support_recursive_import
138
140
  books.each do |book|
139
141
  assert_equal book.topic_id, second_new_topic.id
140
142
  end
143
+
144
+ books.each { |book| book.topic_id = nil }
145
+ assert_no_difference "Book.count", books.size do
146
+ Book.import books, validate: false, on_duplicate_key_update: [:topic_id]
147
+ end
148
+
149
+ books.each do |book|
150
+ assert_nil book.topic_id, nil
151
+ end
141
152
  end
142
153
 
143
154
  unless ENV["SKIP_COMPOSITE_PK"]
@@ -154,6 +165,24 @@ def should_support_recursive_import
154
165
  assert_equal 1, tags[0].tag_id
155
166
  assert_equal 2, tags[1].tag_id
156
167
  end
168
+
169
+ if ENV['AR_VERSION'].to_f >= 7.1
170
+ it "should import models with auto-incrementing ID successfully with recursive set to true" do
171
+ author = Author.create!(name: "Foo Barson")
172
+ books = []
173
+ 2.times do |i|
174
+ books << CompositeBook.new(author_id: author.id, title: "Book #{i}", composite_chapters: [
175
+ CompositeChapter.new(title: "Book #{i} composite chapter 1"),
176
+ CompositeChapter.new(title: "Book #{i} composite chapter 2"),
177
+ ])
178
+ end
179
+ assert_difference "CompositeBook.count", +2 do
180
+ assert_difference "CompositeChapter.count", +4 do
181
+ CompositeBook.import books, recursive: true
182
+ end
183
+ end
184
+ end
185
+ end
157
186
  end
158
187
  end
159
188
 
@@ -167,7 +196,7 @@ def should_support_recursive_import
167
196
  end
168
197
  end
169
198
 
170
- # If adapter supports on_duplicate_key_update, it is only applied to top level models so that SQL with invalid
199
+ # If adapter supports on_duplicate_key_update and specific columns are specified, it is only applied to top level models so that SQL with invalid
171
200
  # columns, keys, etc isn't generated for child associations when doing recursive import
172
201
  if ActiveRecord::Base.connection.supports_on_duplicate_key_update?
173
202
  describe "on_duplicate_key_update" do
@@ -181,6 +210,74 @@ def should_support_recursive_import
181
210
  end
182
211
  end
183
212
  end
213
+
214
+ context "when :all fields are updated" do
215
+ setup do
216
+ Topic.import new_topics, recursive: true
217
+ end
218
+
219
+ it "updates associated objects" do
220
+ new_author_name = 'Richard Bachman'
221
+ topic = new_topics.first
222
+ topic.books.each do |book|
223
+ book.author_name = new_author_name
224
+ end
225
+ assert_nothing_raised do
226
+ Topic.import new_topics, recursive: true, on_duplicate_key_update: :all
227
+ end
228
+ Topic.find(topic.id).books.each do |book|
229
+ assert_equal new_author_name, book.author_name
230
+ end
231
+ end
232
+ end
233
+ end
234
+
235
+ describe "recursive_on_duplicate_key_update" do
236
+ let(:new_topics) { Build(1, :topic_with_book) }
237
+
238
+ setup do
239
+ Topic.import new_topics, recursive: true
240
+ end
241
+
242
+ it "updates associated objects" do
243
+ new_author_name = 'Richard Bachman'
244
+ topic = new_topics.first
245
+ topic.books.each do |book|
246
+ book.author_name = new_author_name
247
+ end
248
+
249
+ assert_nothing_raised do
250
+ Topic.import new_topics,
251
+ recursive: true,
252
+ on_duplicate_key_update: [:id],
253
+ recursive_on_duplicate_key_update: {
254
+ books: { conflict_target: [:id], columns: [:author_name] }
255
+ }
256
+ end
257
+ Topic.find(topic.id).books.each do |book|
258
+ assert_equal new_author_name, book.author_name
259
+ end
260
+ end
261
+
262
+ it "updates nested associated objects" do
263
+ new_chapter_title = 'The Final Chapter'
264
+ book = new_topics.first.books.first
265
+ book.author_name = 'Richard Bachman'
266
+
267
+ example_chapter = book.chapters.first
268
+ example_chapter.title = new_chapter_title
269
+
270
+ assert_nothing_raised do
271
+ Topic.import new_topics,
272
+ recursive: true,
273
+ on_duplicate_key_update: [:id],
274
+ recursive_on_duplicate_key_update: {
275
+ books: { conflict_target: [:id], columns: [:author_name] },
276
+ chapters: { conflict_target: [:id], columns: [:title] }
277
+ }
278
+ end
279
+ assert_equal new_chapter_title, Chapter.find(example_chapter.id).title
280
+ end
184
281
  end
185
282
  end
186
283
 
@@ -1,4 +1,5 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  def should_support_sqlite3_import_functionality
3
4
  if ActiveRecord::Base.connection.supports_on_duplicate_key_update?
4
5
  should_support_sqlite_upsert_functionality
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path('../test_helper', __FILE__)
2
4
 
3
5
  describe ".synchronize" do
data/test/test_helper.rb CHANGED
@@ -1,4 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pathname'
4
+ require 'rake'
2
5
  test_dir = Pathname.new File.dirname(__FILE__)
3
6
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
7
  $LOAD_PATH.unshift(File.dirname(__FILE__))
@@ -21,7 +24,7 @@ if ActiveSupport::VERSION::STRING < "4.0"
21
24
  require 'mocha/test_unit'
22
25
  else
23
26
  require 'active_support/testing/autorun'
24
- require "mocha/mini_test"
27
+ require "mocha/minitest"
25
28
  end
26
29
 
27
30
  require 'timecop'
@@ -30,7 +33,9 @@ require 'chronic'
30
33
  begin
31
34
  require 'composite_primary_keys'
32
35
  rescue LoadError
33
- ENV["SKIP_COMPOSITE_PK"] = "true"
36
+ if ENV['AR_VERSION'].to_f <= 7.1
37
+ ENV['SKIP_COMPOSITE_PK'] = 'true'
38
+ end
34
39
  end
35
40
 
36
41
  # Support MySQL 5.7
@@ -48,8 +53,30 @@ adapter = ENV["ARE_DB"] || "sqlite3"
48
53
  FileUtils.mkdir_p 'log'
49
54
  ActiveRecord::Base.logger = Logger.new("log/test.log")
50
55
  ActiveRecord::Base.logger.level = Logger::DEBUG
51
- ActiveRecord::Base.configurations["test"] = YAML.load_file(test_dir.join("database.yml"))[adapter]
52
- ActiveRecord::Base.default_timezone = :utc
56
+
57
+ if ActiveRecord.respond_to?(:use_yaml_unsafe_load)
58
+ ActiveRecord.use_yaml_unsafe_load = true
59
+ elsif ActiveRecord::Base.respond_to?(:use_yaml_unsafe_load)
60
+ ActiveRecord::Base.use_yaml_unsafe_load = true
61
+ end
62
+
63
+ if ENV['AR_VERSION'].to_f >= 6.0
64
+ yaml_config = if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.2.1')
65
+ YAML.safe_load_file(test_dir.join("database.yml"), aliases: true)[adapter]
66
+ else
67
+ YAML.load_file(test_dir.join("database.yml"))[adapter]
68
+ end
69
+ config = ActiveRecord::DatabaseConfigurations::HashConfig.new("test", adapter, yaml_config)
70
+ ActiveRecord::Base.configurations.configurations << config
71
+ else
72
+ ActiveRecord::Base.configurations["test"] = YAML.load_file(test_dir.join("database.yml"))[adapter]
73
+ end
74
+
75
+ if ActiveRecord.respond_to?(:default_timezone)
76
+ ActiveRecord.default_timezone = :utc
77
+ else
78
+ ActiveRecord::Base.default_timezone = :utc
79
+ end
53
80
 
54
81
  require "activerecord-import"
55
82
  ActiveRecord::Base.establish_connection :test
@@ -59,7 +86,7 @@ ActiveSupport::Notifications.subscribe(/active_record.sql/) do |_, _, _, _, hsh|
59
86
  end
60
87
 
61
88
  require "factory_bot"
62
- Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each { |file| require file }
89
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |file| require file }
63
90
 
64
91
  # Load base/generic schema
65
92
  require test_dir.join("schema/version")
@@ -67,7 +94,7 @@ require test_dir.join("schema/generic_schema")
67
94
  adapter_schema = test_dir.join("schema/#{adapter}_schema.rb")
68
95
  require adapter_schema if File.exist?(adapter_schema)
69
96
 
70
- Dir[File.dirname(__FILE__) + "/models/*.rb"].each { |file| require file }
97
+ Dir["#{File.dirname(__FILE__)}/models/*.rb"].sort.each { |file| require file }
71
98
 
72
99
  # Prevent this deprecation warning from breaking the tests.
73
100
  Rake::FileList.send(:remove_method, :import)
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require File.expand_path("#{File.dirname(__FILE__)}/../test_helper")
4
+ require File.expand_path("#{File.dirname(__FILE__)}/../support/assertions")
5
+ require File.expand_path("#{File.dirname(__FILE__)}/../support/mysql/import_examples")
6
+
7
+ should_support_mysql_import_functionality
@@ -1,4 +1,6 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/test_helper')
1
+ # frozen_string_literal: true
2
+
3
+ require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
2
4
 
3
5
  require 'activerecord-import/value_sets_parser'
4
6
 
@@ -1,4 +1,6 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/test_helper')
1
+ # frozen_string_literal: true
2
+
3
+ require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
2
4
 
3
5
  require 'activerecord-import/value_sets_parser'
4
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-import
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Dennis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-01 00:00:00.000000000 Z
11
+ date: 2024-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.2'
19
+ version: '4.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '3.2'
26
+ version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -45,12 +45,13 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - ".github/workflows/test.yaml"
48
49
  - ".gitignore"
49
50
  - ".rubocop.yml"
50
51
  - ".rubocop_todo.yml"
51
- - ".travis.yml"
52
52
  - Brewfile
53
53
  - CHANGELOG.md
54
+ - Dockerfile
54
55
  - Gemfile
55
56
  - LICENSE
56
57
  - README.markdown
@@ -67,16 +68,16 @@ files:
67
68
  - benchmarks/models/test_innodb.rb
68
69
  - benchmarks/models/test_memory.rb
69
70
  - benchmarks/models/test_myisam.rb
70
- - benchmarks/schema/mysql_schema.rb
71
- - gemfiles/3.2.gemfile
72
- - gemfiles/4.0.gemfile
73
- - gemfiles/4.1.gemfile
71
+ - benchmarks/schema/mysql2_schema.rb
72
+ - docker-compose.yml
74
73
  - gemfiles/4.2.gemfile
75
74
  - gemfiles/5.0.gemfile
76
75
  - gemfiles/5.1.gemfile
77
76
  - gemfiles/5.2.gemfile
78
77
  - gemfiles/6.0.gemfile
79
78
  - gemfiles/6.1.gemfile
79
+ - gemfiles/7.0.gemfile
80
+ - gemfiles/7.1.gemfile
80
81
  - lib/activerecord-import.rb
81
82
  - lib/activerecord-import/active_record/adapters/abstract_adapter.rb
82
83
  - lib/activerecord-import/active_record/adapters/jdbcmysql_adapter.rb
@@ -86,12 +87,14 @@ files:
86
87
  - lib/activerecord-import/active_record/adapters/postgresql_adapter.rb
87
88
  - lib/activerecord-import/active_record/adapters/seamless_database_pool_adapter.rb
88
89
  - lib/activerecord-import/active_record/adapters/sqlite3_adapter.rb
90
+ - lib/activerecord-import/active_record/adapters/trilogy_adapter.rb
89
91
  - lib/activerecord-import/adapters/abstract_adapter.rb
90
92
  - lib/activerecord-import/adapters/em_mysql2_adapter.rb
91
93
  - lib/activerecord-import/adapters/mysql2_adapter.rb
92
94
  - lib/activerecord-import/adapters/mysql_adapter.rb
93
95
  - lib/activerecord-import/adapters/postgresql_adapter.rb
94
96
  - lib/activerecord-import/adapters/sqlite3_adapter.rb
97
+ - lib/activerecord-import/adapters/trilogy_adapter.rb
95
98
  - lib/activerecord-import/base.rb
96
99
  - lib/activerecord-import/import.rb
97
100
  - lib/activerecord-import/mysql2.rb
@@ -113,7 +116,9 @@ files:
113
116
  - test/adapters/seamless_database_pool.rb
114
117
  - test/adapters/spatialite.rb
115
118
  - test/adapters/sqlite3.rb
119
+ - test/adapters/trilogy.rb
116
120
  - test/database.yml.sample
121
+ - test/github/database.yml
117
122
  - test/import_test.rb
118
123
  - test/jdbcmysql/import_test.rb
119
124
  - test/jdbcpostgresql/import_test.rb
@@ -121,18 +126,28 @@ files:
121
126
  - test/makara_postgis/import_test.rb
122
127
  - test/models/account.rb
123
128
  - test/models/alarm.rb
129
+ - test/models/animal.rb
130
+ - test/models/author.rb
124
131
  - test/models/bike_maker.rb
125
132
  - test/models/book.rb
126
133
  - test/models/car.rb
134
+ - test/models/card.rb
127
135
  - test/models/chapter.rb
136
+ - test/models/composite_book.rb
137
+ - test/models/composite_chapter.rb
138
+ - test/models/customer.rb
139
+ - test/models/deck.rb
128
140
  - test/models/dictionary.rb
129
141
  - test/models/discount.rb
130
142
  - test/models/end_note.rb
131
143
  - test/models/group.rb
144
+ - test/models/order.rb
145
+ - test/models/playing_card.rb
132
146
  - test/models/promotion.rb
133
147
  - test/models/question.rb
134
148
  - test/models/rule.rb
135
149
  - test/models/tag.rb
150
+ - test/models/tag_alias.rb
136
151
  - test/models/topic.rb
137
152
  - test/models/user.rb
138
153
  - test/models/user_token.rb
@@ -163,12 +178,12 @@ files:
163
178
  - test/support/sqlite3/import_examples.rb
164
179
  - test/synchronize_test.rb
165
180
  - test/test_helper.rb
166
- - test/travis/database.yml
181
+ - test/trilogy/import_test.rb
167
182
  - test/value_sets_bytes_parser_test.rb
168
183
  - test/value_sets_records_parser_test.rb
169
- homepage: http://github.com/zdennis/activerecord-import
184
+ homepage: https://github.com/zdennis/activerecord-import
170
185
  licenses:
171
- - Ruby
186
+ - MIT
172
187
  metadata: {}
173
188
  post_install_message:
174
189
  rdoc_options: []
@@ -178,15 +193,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
178
193
  requirements:
179
194
  - - ">="
180
195
  - !ruby/object:Gem::Version
181
- version: 1.9.2
196
+ version: 2.4.0
182
197
  required_rubygems_version: !ruby/object:Gem::Requirement
183
198
  requirements:
184
199
  - - ">="
185
200
  - !ruby/object:Gem::Version
186
201
  version: '0'
187
202
  requirements: []
188
- rubyforge_project:
189
- rubygems_version: 2.7.8
203
+ rubygems_version: 3.0.3.1
190
204
  signing_key:
191
205
  specification_version: 4
192
206
  summary: Bulk insert extension for ActiveRecord
@@ -204,7 +218,9 @@ test_files:
204
218
  - test/adapters/seamless_database_pool.rb
205
219
  - test/adapters/spatialite.rb
206
220
  - test/adapters/sqlite3.rb
221
+ - test/adapters/trilogy.rb
207
222
  - test/database.yml.sample
223
+ - test/github/database.yml
208
224
  - test/import_test.rb
209
225
  - test/jdbcmysql/import_test.rb
210
226
  - test/jdbcpostgresql/import_test.rb
@@ -212,18 +228,28 @@ test_files:
212
228
  - test/makara_postgis/import_test.rb
213
229
  - test/models/account.rb
214
230
  - test/models/alarm.rb
231
+ - test/models/animal.rb
232
+ - test/models/author.rb
215
233
  - test/models/bike_maker.rb
216
234
  - test/models/book.rb
217
235
  - test/models/car.rb
236
+ - test/models/card.rb
218
237
  - test/models/chapter.rb
238
+ - test/models/composite_book.rb
239
+ - test/models/composite_chapter.rb
240
+ - test/models/customer.rb
241
+ - test/models/deck.rb
219
242
  - test/models/dictionary.rb
220
243
  - test/models/discount.rb
221
244
  - test/models/end_note.rb
222
245
  - test/models/group.rb
246
+ - test/models/order.rb
247
+ - test/models/playing_card.rb
223
248
  - test/models/promotion.rb
224
249
  - test/models/question.rb
225
250
  - test/models/rule.rb
226
251
  - test/models/tag.rb
252
+ - test/models/tag_alias.rb
227
253
  - test/models/topic.rb
228
254
  - test/models/user.rb
229
255
  - test/models/user_token.rb
@@ -254,6 +280,6 @@ test_files:
254
280
  - test/support/sqlite3/import_examples.rb
255
281
  - test/synchronize_test.rb
256
282
  - test/test_helper.rb
257
- - test/travis/database.yml
283
+ - test/trilogy/import_test.rb
258
284
  - test/value_sets_bytes_parser_test.rb
259
285
  - test/value_sets_records_parser_test.rb
data/.travis.yml DELETED
@@ -1,70 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - 2.5.5
5
-
6
- env:
7
- global:
8
- # https://github.com/discourse/discourse/blob/master/.travis.yml
9
- - RUBY_GC_MALLOC_LIMIT=50000000
10
- matrix:
11
- - AR_VERSION=5.1
12
- - AR_VERSION=5.2
13
- - AR_VERSION=6.0
14
-
15
- matrix:
16
- include:
17
- - rvm: 2.3.8
18
- env: AR_VERSION=3.2
19
- - rvm: 2.3.8
20
- env: AR_VERSION=4.0
21
- - rvm: 2.3.8
22
- env: AR_VERSION=4.1
23
- - rvm: 2.3.8
24
- env: AR_VERSION=4.2
25
- - rvm: 2.3.8
26
- env: AR_VERSION=5.0
27
-
28
- fast_finish: true
29
-
30
- addons:
31
- postgresql: "9.5"
32
- apt:
33
- sources:
34
- - travis-ci/sqlite3
35
- - mysql-5.7-trusty
36
- packages:
37
- - sqlite3
38
- - mysql-server
39
- - mysql-client
40
- - postgresql-9.5-postgis-2.3
41
-
42
- before_install:
43
- - gem update --system
44
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
45
- - sudo mysql_upgrade
46
- - sudo service mysql restart
47
-
48
- before_script:
49
- - mysql -e 'create database activerecord_import_test;'
50
- - psql -c 'create database activerecord_import_test;' -U postgres
51
- - psql activerecord_import_test -c 'create extension if not exists hstore;' -U postgres
52
- - psql -c 'create extension if not exists postgis;' -U postgres
53
- - psql -c 'create extension if not exists "uuid-ossp";' -U postgres
54
- - cp test/travis/database.yml test/database.yml
55
-
56
- script:
57
- - bundle exec rake test:mysql2
58
- - bundle exec rake test:mysql2_makara
59
- - bundle exec rake test:mysql2spatial
60
- - bundle exec rake test:postgis
61
- - bundle exec rake test:postgresql
62
- - bundle exec rake test:postgresql_makara
63
- - bundle exec rake test:seamless_database_pool
64
- - bundle exec rake test:spatialite
65
- - bundle exec rake test:sqlite3
66
- - bundle exec rubocop
67
-
68
- dist: trusty
69
-
70
- sudo: required
data/gemfiles/3.2.gemfile DELETED
@@ -1,2 +0,0 @@
1
- gem 'activerecord', '~> 3.2.0'
2
- gem 'composite_primary_keys', '~> 5.0'
data/gemfiles/4.0.gemfile DELETED
@@ -1,2 +0,0 @@
1
- gem 'activerecord', '~> 4.0.0'
2
- gem 'composite_primary_keys', '~> 6.0'
data/gemfiles/4.1.gemfile DELETED
@@ -1,2 +0,0 @@
1
- gem 'activerecord', '~> 4.1.0'
2
- gem 'composite_primary_keys', '~> 7.0'