activerecord-import 1.0.2 → 1.5.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.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yaml +113 -0
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +74 -8
  5. data/.rubocop_todo.yml +6 -16
  6. data/Brewfile +3 -1
  7. data/CHANGELOG.md +115 -3
  8. data/Gemfile +12 -10
  9. data/LICENSE +21 -56
  10. data/README.markdown +71 -60
  11. data/Rakefile +2 -0
  12. data/activerecord-import.gemspec +6 -5
  13. data/benchmarks/benchmark.rb +10 -4
  14. data/benchmarks/lib/base.rb +4 -2
  15. data/benchmarks/lib/cli_parser.rb +4 -2
  16. data/benchmarks/lib/float.rb +2 -0
  17. data/benchmarks/lib/mysql2_benchmark.rb +2 -0
  18. data/benchmarks/lib/output_to_csv.rb +2 -0
  19. data/benchmarks/lib/output_to_html.rb +4 -2
  20. data/benchmarks/models/test_innodb.rb +2 -0
  21. data/benchmarks/models/test_memory.rb +2 -0
  22. data/benchmarks/models/test_myisam.rb +2 -0
  23. data/benchmarks/schema/{mysql_schema.rb → mysql2_schema.rb} +2 -0
  24. data/gemfiles/4.2.gemfile +2 -0
  25. data/gemfiles/5.0.gemfile +2 -0
  26. data/gemfiles/5.1.gemfile +2 -0
  27. data/gemfiles/5.2.gemfile +2 -0
  28. data/gemfiles/6.0.gemfile +4 -1
  29. data/gemfiles/6.1.gemfile +4 -1
  30. data/gemfiles/7.0.gemfile +4 -0
  31. data/lib/activerecord-import/active_record/adapters/abstract_adapter.rb +2 -0
  32. data/lib/activerecord-import/active_record/adapters/jdbcmysql_adapter.rb +6 -4
  33. data/lib/activerecord-import/active_record/adapters/jdbcpostgresql_adapter.rb +2 -0
  34. data/lib/activerecord-import/active_record/adapters/jdbcsqlite3_adapter.rb +2 -0
  35. data/lib/activerecord-import/active_record/adapters/mysql2_adapter.rb +2 -0
  36. data/lib/activerecord-import/active_record/adapters/postgresql_adapter.rb +2 -0
  37. data/lib/activerecord-import/active_record/adapters/seamless_database_pool_adapter.rb +2 -0
  38. data/lib/activerecord-import/active_record/adapters/sqlite3_adapter.rb +2 -0
  39. data/lib/activerecord-import/adapters/abstract_adapter.rb +14 -5
  40. data/lib/activerecord-import/adapters/em_mysql2_adapter.rb +2 -0
  41. data/lib/activerecord-import/adapters/mysql2_adapter.rb +2 -0
  42. data/lib/activerecord-import/adapters/mysql_adapter.rb +33 -25
  43. data/lib/activerecord-import/adapters/postgresql_adapter.rb +69 -56
  44. data/lib/activerecord-import/adapters/sqlite3_adapter.rb +39 -39
  45. data/lib/activerecord-import/base.rb +10 -2
  46. data/lib/activerecord-import/import.rb +143 -62
  47. data/lib/activerecord-import/mysql2.rb +2 -0
  48. data/lib/activerecord-import/postgresql.rb +2 -0
  49. data/lib/activerecord-import/sqlite3.rb +2 -0
  50. data/lib/activerecord-import/synchronize.rb +3 -1
  51. data/lib/activerecord-import/value_sets_parser.rb +5 -0
  52. data/lib/activerecord-import/version.rb +3 -1
  53. data/lib/activerecord-import.rb +3 -1
  54. data/test/adapters/jdbcmysql.rb +2 -0
  55. data/test/adapters/jdbcpostgresql.rb +2 -0
  56. data/test/adapters/jdbcsqlite3.rb +2 -0
  57. data/test/adapters/makara_postgis.rb +2 -0
  58. data/test/adapters/mysql2.rb +2 -0
  59. data/test/adapters/mysql2_makara.rb +2 -0
  60. data/test/adapters/mysql2spatial.rb +2 -0
  61. data/test/adapters/postgis.rb +2 -0
  62. data/test/adapters/postgresql.rb +2 -0
  63. data/test/adapters/postgresql_makara.rb +2 -0
  64. data/test/adapters/seamless_database_pool.rb +2 -0
  65. data/test/adapters/spatialite.rb +2 -0
  66. data/test/adapters/sqlite3.rb +2 -0
  67. data/test/{travis → github}/database.yml +3 -1
  68. data/test/import_test.rb +93 -2
  69. data/test/jdbcmysql/import_test.rb +5 -3
  70. data/test/jdbcpostgresql/import_test.rb +4 -2
  71. data/test/jdbcsqlite3/import_test.rb +4 -2
  72. data/test/makara_postgis/import_test.rb +4 -2
  73. data/test/models/account.rb +2 -0
  74. data/test/models/alarm.rb +2 -0
  75. data/test/models/animal.rb +8 -0
  76. data/test/models/bike_maker.rb +3 -0
  77. data/test/models/book.rb +2 -0
  78. data/test/models/car.rb +2 -0
  79. data/test/models/card.rb +5 -0
  80. data/test/models/chapter.rb +2 -0
  81. data/test/models/customer.rb +8 -0
  82. data/test/models/deck.rb +8 -0
  83. data/test/models/dictionary.rb +2 -0
  84. data/test/models/discount.rb +2 -0
  85. data/test/models/end_note.rb +2 -0
  86. data/test/models/group.rb +2 -0
  87. data/test/models/order.rb +8 -0
  88. data/test/models/playing_card.rb +4 -0
  89. data/test/models/promotion.rb +2 -0
  90. data/test/models/question.rb +2 -0
  91. data/test/models/rule.rb +2 -0
  92. data/test/models/tag.rb +3 -0
  93. data/test/models/tag_alias.rb +5 -0
  94. data/test/models/topic.rb +7 -0
  95. data/test/models/user.rb +2 -0
  96. data/test/models/user_token.rb +2 -0
  97. data/test/models/vendor.rb +2 -0
  98. data/test/models/widget.rb +2 -0
  99. data/test/mysql2/import_test.rb +5 -3
  100. data/test/mysql2_makara/import_test.rb +5 -3
  101. data/test/mysqlspatial2/import_test.rb +5 -3
  102. data/test/postgis/import_test.rb +4 -2
  103. data/test/postgresql/import_test.rb +4 -2
  104. data/test/schema/generic_schema.rb +34 -0
  105. data/test/schema/jdbcpostgresql_schema.rb +3 -1
  106. data/test/schema/mysql2_schema.rb +2 -0
  107. data/test/schema/postgis_schema.rb +3 -1
  108. data/test/schema/postgresql_schema.rb +16 -0
  109. data/test/schema/sqlite3_schema.rb +2 -0
  110. data/test/schema/version.rb +2 -0
  111. data/test/sqlite3/import_test.rb +4 -2
  112. data/test/support/active_support/test_case_extensions.rb +2 -0
  113. data/test/support/assertions.rb +2 -0
  114. data/test/support/factories.rb +2 -0
  115. data/test/support/generate.rb +4 -2
  116. data/test/support/mysql/import_examples.rb +2 -1
  117. data/test/support/postgresql/import_examples.rb +96 -2
  118. data/test/support/shared_examples/on_duplicate_key_ignore.rb +2 -0
  119. data/test/support/shared_examples/on_duplicate_key_update.rb +50 -9
  120. data/test/support/shared_examples/recursive_import.rb +32 -1
  121. data/test/support/sqlite3/import_examples.rb +2 -1
  122. data/test/synchronize_test.rb +2 -0
  123. data/test/test_helper.rb +30 -5
  124. data/test/value_sets_bytes_parser_test.rb +3 -1
  125. data/test/value_sets_records_parser_test.rb +3 -1
  126. metadata +27 -16
  127. data/.travis.yml +0 -70
  128. data/gemfiles/3.2.gemfile +0 -2
  129. data/gemfiles/4.0.gemfile +0 -2
  130. data/gemfiles/4.1.gemfile +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5448c6493533f39965a0b3cd0f00e3d2811e7f8feaa2f806e20b47d8db504c27
4
- data.tar.gz: fde9e0e991022d01d339da3da9b89d0523771533fc684d3d955af91b718bede2
3
+ metadata.gz: 866dd09466fbda981329e13916e89986cb47d65259f0889b8a3b53aeca1aee32
4
+ data.tar.gz: 258a0d2fc34bbb928500e2f8a83df4f5bdc8901c25e2e123a569c56d587d3f53
5
5
  SHA512:
6
- metadata.gz: 1048e6bb250eb8cedb71d37dad9e13245799638e948f83016e3301ea933418327fe294438ab862d0cf1c521da51fabd8ac648f16798d1f44a62cb4784176a60a
7
- data.tar.gz: e764901dc217df8fb650a788064fcd274d7141e0a3e201ecc9011aa0ce5ce89ff7bb06d899543e084543bf52e54d8feb81c6a17d464e3a81b7df5ee187c2614d
6
+ metadata.gz: 989562e1fb64d669a96211c6b80df5b89d8a43aa38575ec6706d0633b405983a63849bd5fb78d4031ed7e4b2c239192f62d4b3d9e720f4c474cd3801600d11ef
7
+ data.tar.gz: 22e6ccbb750bb7851930d98c2b90f496c759d35503c8c1e58b841f4a928a283c486caec3f22cb57e6948b6960e6fff2a598499f0670f59b281e321dded20c183
@@ -0,0 +1,113 @@
1
+ name: Test
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ services:
6
+ postgres:
7
+ image: postgis/postgis:10-2.5
8
+ env:
9
+ POSTGRES_USER: postgres
10
+ POSTGRES_PASSWORD: postgres
11
+ ports:
12
+ - 5432:5432
13
+ # Set health checks to wait until postgres has started
14
+ options: >-
15
+ --health-cmd pg_isready
16
+ --health-interval 10s
17
+ --health-timeout 5s
18
+ --health-retries 5
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ ruby:
23
+ - 3.2
24
+ env:
25
+ - AR_VERSION: '7.0'
26
+ RUBYOPT: --enable-frozen-string-literal
27
+ - AR_VERSION: 6.1
28
+ RUBYOPT: --enable-frozen-string-literal
29
+ include:
30
+ - ruby: 3.1
31
+ env:
32
+ AR_VERSION: '7.0'
33
+ - ruby: 3.1
34
+ env:
35
+ AR_VERSION: 6.1
36
+ - ruby: '3.0'
37
+ env:
38
+ AR_VERSION: '7.0'
39
+ - ruby: '3.0'
40
+ env:
41
+ AR_VERSION: 6.1
42
+ - ruby: 2.7
43
+ env:
44
+ AR_VERSION: '7.0'
45
+ - ruby: 2.7
46
+ env:
47
+ AR_VERSION: 6.1
48
+ - ruby: 2.7
49
+ env:
50
+ AR_VERSION: '6.0'
51
+ - ruby: 2.6
52
+ env:
53
+ AR_VERSION: 5.2
54
+ - ruby: 2.6
55
+ env:
56
+ AR_VERSION: 5.1
57
+ - ruby: 2.4
58
+ env:
59
+ AR_VERSION: '5.0'
60
+ - ruby: 2.4
61
+ env:
62
+ AR_VERSION: 4.2
63
+ runs-on: ubuntu-latest
64
+ env:
65
+ AR_VERSION: ${{ matrix.env.AR_VERSION }}
66
+ DB_DATABASE: activerecord_import_test
67
+ steps:
68
+ - uses: actions/checkout@v2
69
+ - uses: ruby/setup-ruby@v1
70
+ with:
71
+ ruby-version: ${{ matrix.ruby }}
72
+ bundler-cache: true
73
+ - name: Set up databases
74
+ run: |
75
+ sudo /etc/init.d/mysql start
76
+ mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }} CHARACTER SET utf8 COLLATE utf8_general_ci;' -u root -proot
77
+ psql -h localhost -U postgres -c 'create database ${{ env.DB_DATABASE }};'
78
+ psql -h localhost -U postgres -d ${{ env.DB_DATABASE }} -c 'create extension if not exists hstore;'
79
+ psql -h localhost -U postgres -c 'create extension if not exists postgis;'
80
+ psql -h localhost -U postgres -c 'create extension if not exists "uuid-ossp";'
81
+ cp test/github/database.yml test/database.yml
82
+ env:
83
+ PGPASSWORD: postgres
84
+ - name: Run tests with mysql2
85
+ run: |
86
+ bundle exec rake test:mysql2
87
+ bundle exec rake test:mysql2_makara
88
+ bundle exec rake test:mysql2spatial
89
+ - name: Run tests with postgresql
90
+ run: |
91
+ bundle exec rake test:postgis
92
+ bundle exec rake test:postgresql
93
+ bundle exec rake test:postgresql_makara
94
+ - name: Run tests with seamless_database_pool
95
+ run: |
96
+ bundle exec rake test:seamless_database_pool
97
+ if: ${{ matrix.ruby < '3.0' }}
98
+ - name: Run tests with sqlite
99
+ run: |
100
+ bundle exec rake test:spatialite
101
+ bundle exec rake test:sqlite3
102
+ lint:
103
+ runs-on: ubuntu-latest
104
+ env:
105
+ AR_VERSION: '7.0'
106
+ steps:
107
+ - uses: actions/checkout@v2
108
+ - uses: ruby/setup-ruby@v1
109
+ with:
110
+ ruby-version: 2.7
111
+ bundler-cache: true
112
+ - name: Run Rubocop
113
+ run: bundle exec rubocop
data/.gitignore CHANGED
@@ -24,6 +24,7 @@ pkg
24
24
  log/*.log
25
25
  test.db
26
26
  test/database.yml
27
+ benchmarks/log/
27
28
 
28
29
  .ruby-*
29
30
  .bundle/
data/.rubocop.yml CHANGED
@@ -1,11 +1,11 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
- Lint/EndAlignment:
4
- AlignWith: variable
5
-
6
3
  Metrics/AbcSize:
7
4
  Enabled: false
8
5
 
6
+ Metrics/BlockLength:
7
+ Enabled: false
8
+
9
9
  Metrics/ClassLength:
10
10
  Enabled: false
11
11
 
@@ -24,8 +24,8 @@ Metrics/ModuleLength:
24
24
  Metrics/PerceivedComplexity:
25
25
  Enabled: false
26
26
 
27
- Style/AlignParameters:
28
- EnforcedStyle: with_fixed_indentation
27
+ Style/CommentedKeyword:
28
+ Enabled: false
29
29
 
30
30
  Style/ClassAndModuleChildren:
31
31
  Enabled: false
@@ -33,10 +33,25 @@ Style/ClassAndModuleChildren:
33
33
  Style/Documentation:
34
34
  Enabled: false
35
35
 
36
- Style/ElseAlignment:
36
+ Style/EvalWithLocation:
37
+ Enabled: false
38
+
39
+ Style/ExpandPathArguments:
40
+ Enabled: false
41
+
42
+ Style/GuardClause:
43
+ Enabled: false
44
+
45
+ Style/IfUnlessModifier:
46
+ Enabled: false
47
+
48
+ Style/NumericPredicate:
49
+ Enabled: false
50
+
51
+ Style/PercentLiteralDelimiters:
37
52
  Enabled: false
38
53
 
39
- Style/SpaceInsideParens:
54
+ Style/RedundantBegin:
40
55
  Enabled: false
41
56
 
42
57
  Style/SpecialGlobalVars:
@@ -45,5 +60,56 @@ Style/SpecialGlobalVars:
45
60
  Style/StringLiterals:
46
61
  Enabled: false
47
62
 
48
- Style/TrailingCommaInLiteral:
63
+ Style/SymbolArray:
64
+ Enabled: false
65
+
66
+ Style/TrailingCommaInArrayLiteral:
67
+ Enabled: false
68
+
69
+ Layout/ArgumentAlignment:
70
+ Enabled: false
71
+
72
+ Layout/ParameterAlignment:
73
+ EnforcedStyle: with_fixed_indentation
74
+
75
+ Layout/EndAlignment:
76
+ EnforcedStyleAlignWith: variable
77
+
78
+ Layout/ElseAlignment:
79
+ Enabled: false
80
+
81
+ Layout/EmptyLineAfterGuardClause:
82
+ Enabled: false
83
+
84
+ Layout/HeredocIndentation:
85
+ Enabled: false
86
+
87
+ Layout/SpaceInsideParens:
88
+ Enabled: false
89
+
90
+ Layout/SpaceInsidePercentLiteralDelimiters:
91
+ Enabled: false
92
+
93
+ Lint/ErbNewArguments:
94
+ Enabled: false
95
+
96
+ Lint/MissingCopEnableDirective:
97
+ Enabled: false
98
+
99
+ Lint/PercentStringArray:
100
+ Enabled: false
101
+
102
+ Naming/HeredocDelimiterNaming:
103
+ Enabled: false
104
+
105
+ Naming/MethodParameterName:
106
+ Enabled: false
107
+
108
+ Security/YAMLLoad:
109
+ Enabled: false
110
+
111
+ Gemspec/RequiredRubyVersion:
112
+ Enabled: false
113
+
114
+ Bundler/OrderedGems:
49
115
  Enabled: false
data/.rubocop_todo.yml CHANGED
@@ -1,36 +1,26 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2016-03-17 18:14:55 -0700 using RuboCop version 0.38.0.
3
+ # on 2023-02-15 00:58:14 UTC using RuboCop version 1.45.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 2
10
- Lint/HandleExceptions:
11
- Exclude:
12
- - 'lib/activerecord-import/base.rb'
13
- - 'test/import_test.rb'
14
-
15
9
  # Offense count: 2
16
10
  Lint/RescueException:
17
11
  Exclude:
18
12
  - 'benchmarks/lib/cli_parser.rb'
19
13
  - 'test/import_test.rb'
20
14
 
21
- # Offense count: 4
22
- # Cop supports --auto-correct.
23
- # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
15
+ # Offense count: 3
16
+ # This cop supports safe autocorrection (--autocorrect).
17
+ # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
24
18
  Lint/UnusedMethodArgument:
25
19
  Exclude:
26
20
  - 'lib/activerecord-import/adapters/postgresql_adapter.rb'
27
21
  - 'lib/activerecord-import/import.rb'
28
22
 
29
23
  # Offense count: 2
30
- # Cop supports --auto-correct.
31
- # Configuration parameters: Keywords.
32
- # Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW
33
- Style/CommentAnnotation:
24
+ Style/CombinableLoops:
34
25
  Exclude:
35
- - 'benchmarks/lib/cli_parser.rb'
36
- - 'lib/activerecord-import/import.rb'
26
+ - 'test/support/shared_examples/recursive_import.rb'
data/Brewfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  brew "mysql"
2
4
  brew "postgresql"
3
- brew "sqlite"
5
+ brew "sqlite"
data/CHANGELOG.md CHANGED
@@ -1,3 +1,115 @@
1
+ ## Changes in 1.5.0
2
+
3
+ ### New Features
4
+
5
+ * Add Rails 7.1 support. Thanks to @gucki via \##807.
6
+ * Add support for alias attributes. Thanks to @leonidkroka via \##799.
7
+
8
+ ### Fixes
9
+
10
+ * Support for multi-byte column names when splitting queries. Thanks to @TakuyaKurimoto via \##801.
11
+ * Fix issue with track_validation_failures when import models. Thanks to @OtaYohihiro via \##798.
12
+
13
+ ## Changes in 1.4.1
14
+
15
+ ### Fixes
16
+
17
+ * Fix importing models that have required belongs_to associations and use composite primary keys. Thanks to @thoughtbot-summer via \##783.
18
+
19
+ ## Changes in 1.4.0
20
+
21
+ ### New Features
22
+
23
+ * Enable compatibility with frozen string literals. Thanks to @desheikh via \##760.
24
+
25
+ ## Changes in 1.3.0
26
+
27
+ ### Fixes
28
+
29
+ * Ensure correct timestamp values are returned for models after insert. Thanks to @kos1kov via \##756.
30
+ * Restore database_version method to public scope. Thanks to @beauraF via \##753.
31
+
32
+ ### New Features
33
+
34
+ * Add support for ActiveRecord 7.0. Thanks to @nickhammond, @ryanwood, @jkowens via \##749 and \##752.
35
+ * Add support for compound foreign keys. Thanks to @Uladzimiro via \##750.
36
+ * Add support for :recursive combined with on_duplicate_key_update: :all. Thanks to @deathwish via \##746.
37
+
38
+ ## Changes in 1.2.0
39
+
40
+ ### Fixes
41
+
42
+ * Update JDBC MySQL adapter to use mysql2 connection adapter. Thanks to @terencechow via \##744.
43
+ * Fix importing STI models with ActiveRecord 6. Thanks to @clemens1483 via \##743.
44
+ * Use polymorphic_name instead of base_class.name for imports. Thanks to @kmhajjar via \##741.
45
+ * Fix compatibility issue with composite primary keys. Thanks to @dlanileonardo via \##737.
46
+ * Prevent double validation of associations on recursive import.
47
+
48
+ ## Changes in 1.1.0
49
+
50
+ ### New Features
51
+
52
+ * Add batch progress reporting. Thanks to @gee-forr via \##729.
53
+
54
+ ## Changes in 1.0.8
55
+
56
+ ### Fixes
57
+
58
+ * Use correct method for clearing query cache. Thanks to @EtienneDepaulis via \##719.
59
+
60
+ ## Changes in 1.0.7
61
+
62
+ ### New Features
63
+
64
+ * Use @@max_allowed_packet session variable instead of querying SHOW VARIABLES. Thanks to @diclophis via \#706.
65
+ * Add option :track_validation_failures. When this is set to true, failed_instances will be an array of arrays, with each inner array having the form [:index_in_dataset, :object_with_errors]. Thanks to @rorymckinley via \#684.
66
+
67
+ ### Fixes
68
+
69
+ * Prevent mass-assignment errors in Rails strict mode. Thanks to @diclophis via \##709.
70
+
71
+ ## Changes in 1.0.6
72
+
73
+ ### Fixes
74
+
75
+ * Handle after_initialize callbacks. Thanks to @AhMohsen46 via \#691 and
76
+ \#692.
77
+ * Fix regression introduced in 1.0.4. Explicitly allow adapters to
78
+ support on duplicate key update. Thanks to @dsobiera, @jkowens via \#696.
79
+
80
+ ## Changes in 1.0.5
81
+
82
+ ### Fixes
83
+
84
+ * Allow serialized attributes to be returned from import. Thanks to @timanovsky, @jkowens via \#660.
85
+ * Return ActiveRecord::Connection from
86
+ ActiveRecord::Base#establish_connection. Thanks to @reverentF via
87
+ \#663.
88
+ * Support PostgreSQL array. Thanks to @ujihisa via \#669.
89
+ * Skip loading association ids when column changed. Thanks to @Aristat
90
+ via \#673.
91
+
92
+ ## Changes in 1.0.4
93
+
94
+ ### Fixes
95
+
96
+ * Use prepend pattern for ActiveRecord::Base#establish_connection patching. Thanks to @dombesz via \#648.
97
+ * Fix NoMethodError when using PostgreSQL ENUM types. Thanks to @sebcoetzee via \#651.
98
+ * Fix issue updating optimistic lock in Postgres. Thanks to @timanovsky
99
+ via \#656.
100
+
101
+ ## Changes in 1.0.3
102
+
103
+ ### New Features
104
+
105
+ * Add support for ActiveRecord 6.1.0.alpha. Thanks to @imtayadeway via
106
+ \#642.
107
+
108
+ ### Fixes
109
+
110
+ * Return an empty array for results instead of nil when importing empty
111
+ array. Thanks to @gyfis via \#636.
112
+
1
113
  ## Changes in 1.0.2
2
114
 
3
115
  ### New Features
@@ -26,7 +138,7 @@
26
138
  * Fix import issue for models with Postgresql json/jsonb fields. Thanks
27
139
  to @stokarenko via \#594.
28
140
  * Fix issue importing models with timestamps that contain timezone
29
- information. Thaks to @dekaikiwi, @jkowens via \#598.
141
+ information. Thanks to @dekaikiwi, @jkowens via \#598.
30
142
  * Ignore :no_returning when using :recursive option. Thanks to @dgollahon, @jkowens
31
143
  via \#599.
32
144
 
@@ -241,7 +353,7 @@
241
353
  Thanks to @jkowens via \#301.
242
354
  * Allow for custom timestamp columns. Thanks to @mojidabckuu, @jkowens
243
355
  via \#401.
244
-
356
+
245
357
  ### Fixes
246
358
 
247
359
  * Fix ActiveRecord 5 issue coercing boolean values when serializing
@@ -253,7 +365,7 @@
253
365
 
254
366
  * Fix issue where PostgreSQL cannot recognize columns if names
255
367
  include mixed case characters. Thanks to @hugobgranja via \#379.
256
- * Fix an issue for ActiveRecord 5 where serialized fields with
368
+ * Fix an issue for ActiveRecord 5 where serialized fields with
257
369
  default values were not being typecast. Thanks to @whistlerbrk,
258
370
  @jkowens via \#386.
259
371
  * Add option :force_single_insert for MySQL to make sure a single
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
@@ -6,20 +8,24 @@ version = ENV['AR_VERSION'].to_f
6
8
 
7
9
  mysql2_version = '0.3.0'
8
10
  mysql2_version = '0.4.0' if version >= 4.2
11
+ mysql2_version = '0.5.0' if version >= 6.1
9
12
  sqlite3_version = '1.3.0'
10
- sqlite3_version = '1.4.0' if version >= 5.1
13
+ sqlite3_version = '1.4.0' if version >= 6.0
14
+ pg_version = '0.9'
15
+ pg_version = '1.1' if version >= 6.1
11
16
 
12
17
  group :development, :test do
13
- gem 'rubocop', '~> 0.40.0'
18
+ gem 'rubocop'
14
19
  gem 'rake'
15
20
  end
16
21
 
17
22
  # Database Adapters
18
23
  platforms :ruby do
19
24
  gem "mysql2", "~> #{mysql2_version}"
20
- gem "pg", "~> 0.9"
25
+ gem "pg", "~> #{pg_version}"
21
26
  gem "sqlite3", "~> #{sqlite3_version}"
22
- gem "seamless_database_pool", "~> 1.0.20"
27
+ # seamless_database_pool requires Ruby ~> 2.0
28
+ gem "seamless_database_pool", "~> 1.0.20" if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.0.0')
23
29
  end
24
30
 
25
31
  platforms :jruby do
@@ -34,20 +40,16 @@ end
34
40
  gem "factory_bot"
35
41
  gem "timecop"
36
42
  gem "chronic"
37
- gem "mocha", "~> 1.3.0"
43
+ gem "mocha", "~> 2.1.0"
38
44
 
39
45
  # Debugging
40
46
  platforms :jruby do
41
47
  gem "ruby-debug", "= 0.10.4"
42
48
  end
43
49
 
44
- platforms :mri_19 do
45
- gem "debugger"
46
- end
47
-
48
50
  platforms :ruby do
49
51
  gem "pry-byebug"
50
- gem "rb-readline"
52
+ gem "pry", "~> 0.14.0"
51
53
  end
52
54
 
53
55
  if version >= 4.0
data/LICENSE CHANGED
@@ -1,56 +1,21 @@
1
- Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
- You can redistribute it and/or modify it under either the terms of the
3
- 2-clause BSDL (see the file BSDL), or the conditions below:
4
-
5
- 1. You may make and give away verbatim copies of the source form of the
6
- software without restriction, provided that you duplicate all of the
7
- original copyright notices and associated disclaimers.
8
-
9
- 2. You may modify your copy of the software in any way, provided that
10
- you do at least ONE of the following:
11
-
12
- a) place your modifications in the Public Domain or otherwise
13
- make them Freely Available, such as by posting said
14
- modifications to Usenet or an equivalent medium, or by allowing
15
- the author to include your modifications in the software.
16
-
17
- b) use the modified software only within your corporation or
18
- organization.
19
-
20
- c) give non-standard binaries non-standard names, with
21
- instructions on where to get the original software distribution.
22
-
23
- d) make other distribution arrangements with the author.
24
-
25
- 3. You may distribute the software in object code or binary form,
26
- provided that you do at least ONE of the following:
27
-
28
- a) distribute the binaries and library files of the software,
29
- together with instructions (in the manual page or equivalent)
30
- on where to get the original distribution.
31
-
32
- b) accompany the distribution with the machine-readable source of
33
- the software.
34
-
35
- c) give non-standard binaries non-standard names, with
36
- instructions on where to get the original software distribution.
37
-
38
- d) make other distribution arrangements with the author.
39
-
40
- 4. You may modify and include the part of the software into any other
41
- software (possibly commercial). But some files in the distribution
42
- are not written by the author, so that they are not under these terms.
43
-
44
- For the list of those files and their copying conditions, see the
45
- file LEGAL.
46
-
47
- 5. The scripts and library files supplied as input to or produced as
48
- output from the software do not automatically fall under the
49
- copyright of the software, but belong to whomever generated them,
50
- and may be sold commercially, and may be aggregated with this
51
- software.
52
-
53
- 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
- PURPOSE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Zach Dennis <zach.dennis@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.