schema_plus_core 2.2.3 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/prs.yml +173 -0
  3. data/.gitignore +1 -0
  4. data/.simplecov +20 -0
  5. data/Gemfile +4 -1
  6. data/README.md +39 -31
  7. data/Rakefile +2 -0
  8. data/gemfiles/Gemfile.base +1 -1
  9. data/gemfiles/activerecord-5.2/Gemfile.base +2 -1
  10. data/gemfiles/activerecord-5.2/Gemfile.mysql2 +2 -2
  11. data/gemfiles/activerecord-5.2/Gemfile.postgresql +2 -2
  12. data/gemfiles/activerecord-5.2/Gemfile.sqlite3 +3 -3
  13. data/gemfiles/activerecord-6.0/Gemfile.base +4 -0
  14. data/gemfiles/activerecord-6.0/Gemfile.mysql2 +10 -0
  15. data/gemfiles/activerecord-6.0/Gemfile.postgresql +10 -0
  16. data/gemfiles/{activerecord-5.0 → activerecord-6.0}/Gemfile.sqlite3 +3 -3
  17. data/gemfiles/activerecord-6.1/Gemfile.base +4 -0
  18. data/gemfiles/activerecord-6.1/Gemfile.mysql2 +10 -0
  19. data/gemfiles/activerecord-6.1/Gemfile.postgresql +10 -0
  20. data/gemfiles/{activerecord-5.1 → activerecord-6.1}/Gemfile.sqlite3 +3 -3
  21. data/gemfiles/activerecord-7.0/Gemfile.base +4 -0
  22. data/gemfiles/activerecord-7.0/Gemfile.mysql2 +10 -0
  23. data/gemfiles/activerecord-7.0/Gemfile.postgresql +10 -0
  24. data/gemfiles/activerecord-7.0/Gemfile.sqlite3 +10 -0
  25. data/lib/schema_plus/core/active_record/base.rb +6 -4
  26. data/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb +65 -26
  27. data/lib/schema_plus/core/active_record/connection_adapters/mysql2_adapter.rb +17 -7
  28. data/lib/schema_plus/core/active_record/connection_adapters/postgresql/schema_dumper.rb +11 -5
  29. data/lib/schema_plus/core/active_record/connection_adapters/postgresql_adapter.rb +24 -32
  30. data/lib/schema_plus/core/active_record/connection_adapters/sqlite3_adapter.rb +15 -5
  31. data/lib/schema_plus/core/active_record/connection_adapters/table_definition.rb +18 -10
  32. data/lib/schema_plus/core/active_record/migration/command_recorder.rb +4 -2
  33. data/lib/schema_plus/core/active_record/schema.rb +2 -0
  34. data/lib/schema_plus/core/active_record/schema_dumper.rb +16 -2
  35. data/lib/schema_plus/core/middleware.rb +3 -1
  36. data/lib/schema_plus/core/schema_dump.rb +14 -5
  37. data/lib/schema_plus/core/sql_struct.rb +4 -2
  38. data/lib/schema_plus/core/version.rb +3 -1
  39. data/lib/schema_plus/core.rb +4 -4
  40. data/schema_dev.yml +8 -5
  41. data/schema_plus_core.gemspec +9 -10
  42. data/spec/column_spec.rb +3 -2
  43. data/spec/dumper_spec.rb +19 -9
  44. data/spec/index_spec.rb +2 -0
  45. data/spec/middleware_spec.rb +5 -2
  46. data/spec/spec_helper.rb +4 -9
  47. data/spec/sql_struct_spec.rb +2 -0
  48. data/spec/support/enableable.rb +2 -4
  49. data/spec/support/test_reporter.rb +3 -1
  50. metadata +41 -87
  51. data/.travis.yml +0 -25
  52. data/gemfiles/activerecord-5.0/Gemfile.base +0 -3
  53. data/gemfiles/activerecord-5.0/Gemfile.mysql2 +0 -10
  54. data/gemfiles/activerecord-5.0/Gemfile.postgresql +0 -10
  55. data/gemfiles/activerecord-5.1/Gemfile.base +0 -3
  56. data/gemfiles/activerecord-5.1/Gemfile.mysql2 +0 -10
  57. data/gemfiles/activerecord-5.1/Gemfile.postgresql +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5c91ca6a28894c17bf6b73d7b8c57f03500dd6474194e5df25afe8727a3691c
4
- data.tar.gz: 32d4f2437d5d3ff1f31f050fb407f26dc80bdaabeb81f8779dfbfd72182de49e
3
+ metadata.gz: e83e662240a2fb8ed6ac51990070859461834639acdc5a2234ab337a27994652
4
+ data.tar.gz: ade3a5b17dbe22a2c2a279aa0c4ff2caa6f3cc302322848c6196d4ce4cb42e74
5
5
  SHA512:
6
- metadata.gz: 2778bbf477a925da8a58dbb577e0a2ac292a919fd3db813f2d404cce2957438f329f7ed2d567fe1f24ebcde15ea5225cafea854b831db4bb23168983b0d165bd
7
- data.tar.gz: 8571518821c17bf21cbf6ff77c4dec9c4ac29d501323446fd2df30d9453e8918597ca41d2c5aec09aea580feae7ad9ff9a57b7c08c8cc270ec7df73c0d64913f
6
+ metadata.gz: fec53de152f9e7c824db91a6160043c82a4bc2c5da15a5037e4c24d1653aabdeb969c4d2ad61fcf70ffd57931c9d78d277907cf84f24147290740cdfcd6e0244
7
+ data.tar.gz: 3f334eee1e5e2b606312e8a55773c2a33d446628eca83459f0cbe839f3d62435fec1d03daee87194e6a95652ec108a4396f7fbe8739849572513fad998c81401
@@ -0,0 +1,173 @@
1
+ # This file was auto-generated by the schema_dev tool, based on the data in
2
+ # ./schema_dev.yml
3
+ # Please do not edit this file; any changes will be overwritten next time
4
+ # schema_dev gets run.
5
+ ---
6
+ name: CI PR Builds
7
+ 'on':
8
+ push:
9
+ branches:
10
+ - master
11
+ pull_request:
12
+ concurrency:
13
+ group: ci-${{ github.ref }}
14
+ cancel-in-progress: true
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ ruby:
22
+ - '2.5'
23
+ - '2.7'
24
+ - '3.0'
25
+ - '3.1'
26
+ activerecord:
27
+ - '5.2'
28
+ - '6.0'
29
+ - '6.1'
30
+ - '7.0'
31
+ db:
32
+ - mysql2
33
+ - sqlite3
34
+ - skip
35
+ dbversion:
36
+ - skip
37
+ exclude:
38
+ - ruby: '3.0'
39
+ activerecord: '5.2'
40
+ - ruby: '3.1'
41
+ activerecord: '5.2'
42
+ - ruby: '2.5'
43
+ activerecord: '7.0'
44
+ - db: skip
45
+ dbversion: skip
46
+ include:
47
+ - ruby: '2.5'
48
+ activerecord: '5.2'
49
+ db: postgresql
50
+ dbversion: '9.6'
51
+ - ruby: '2.5'
52
+ activerecord: '6.0'
53
+ db: postgresql
54
+ dbversion: '9.6'
55
+ - ruby: '2.5'
56
+ activerecord: '6.1'
57
+ db: postgresql
58
+ dbversion: '9.6'
59
+ - ruby: '2.7'
60
+ activerecord: '5.2'
61
+ db: postgresql
62
+ dbversion: '9.6'
63
+ - ruby: '2.7'
64
+ activerecord: '6.0'
65
+ db: postgresql
66
+ dbversion: '9.6'
67
+ - ruby: '2.7'
68
+ activerecord: '6.1'
69
+ db: postgresql
70
+ dbversion: '9.6'
71
+ - ruby: '2.7'
72
+ activerecord: '7.0'
73
+ db: postgresql
74
+ dbversion: '9.6'
75
+ - ruby: '3.0'
76
+ activerecord: '6.0'
77
+ db: postgresql
78
+ dbversion: '9.6'
79
+ - ruby: '3.0'
80
+ activerecord: '6.1'
81
+ db: postgresql
82
+ dbversion: '9.6'
83
+ - ruby: '3.0'
84
+ activerecord: '7.0'
85
+ db: postgresql
86
+ dbversion: '9.6'
87
+ - ruby: '3.1'
88
+ activerecord: '6.0'
89
+ db: postgresql
90
+ dbversion: '9.6'
91
+ - ruby: '3.1'
92
+ activerecord: '6.1'
93
+ db: postgresql
94
+ dbversion: '9.6'
95
+ - ruby: '3.1'
96
+ activerecord: '7.0'
97
+ db: postgresql
98
+ dbversion: '9.6'
99
+ env:
100
+ BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}/Gemfile.${{ matrix.db }}"
101
+ POSTGRESQL_DB_HOST: 127.0.0.1
102
+ POSTGRESQL_DB_USER: schema_plus_test
103
+ POSTGRESQL_DB_PASS: database
104
+ MYSQL_DB_HOST: 127.0.0.1
105
+ MYSQL_DB_USER: root
106
+ MYSQL_DB_PASS: database
107
+ steps:
108
+ - uses: actions/checkout@v2
109
+ - name: Set up Ruby
110
+ uses: ruby/setup-ruby@v1
111
+ with:
112
+ ruby-version: "${{ matrix.ruby }}"
113
+ bundler-cache: true
114
+ - name: Run bundle update
115
+ run: bundle update
116
+ - name: Start Postgresql
117
+ if: matrix.db == 'postgresql'
118
+ run: |
119
+ docker run --rm --detach \
120
+ -e POSTGRES_USER=$POSTGRESQL_DB_USER \
121
+ -e POSTGRES_PASSWORD=$POSTGRESQL_DB_PASS \
122
+ -p 5432:5432 \
123
+ --health-cmd "pg_isready -q" \
124
+ --health-interval 5s \
125
+ --health-timeout 5s \
126
+ --health-retries 5 \
127
+ --name database postgres:${{ matrix.dbversion }}
128
+ - name: Start Mysql
129
+ if: matrix.db == 'mysql2'
130
+ run: |
131
+ docker run --rm --detach \
132
+ -e MYSQL_ROOT_PASSWORD=$MYSQL_DB_PASS \
133
+ -p 3306:3306 \
134
+ --health-cmd "mysqladmin ping --host=127.0.0.1 --password=$MYSQL_DB_PASS --silent" \
135
+ --health-interval 5s \
136
+ --health-timeout 5s \
137
+ --health-retries 5 \
138
+ --name database mysql:5.6
139
+ - name: Wait for database to start
140
+ if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
141
+ run: |
142
+ COUNT=0
143
+ ATTEMPTS=20
144
+ until [[ $COUNT -eq $ATTEMPTS ]]; do
145
+ [ "$(docker inspect -f {{.State.Health.Status}} database)" == "healthy" ] && break
146
+ echo $(( COUNT++ )) > /dev/null
147
+ sleep 2
148
+ done
149
+ - name: Create testing database
150
+ if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
151
+ run: bundle exec rake create_ci_database
152
+ - name: Run tests
153
+ run: bundle exec rake spec
154
+ - name: Shutdown database
155
+ if: always() && (matrix.db == 'postgresql' || matrix.db == 'mysql2')
156
+ run: docker stop database
157
+ - name: Coveralls Parallel
158
+ if: "${{ !env.ACT }}"
159
+ uses: coverallsapp/github-action@master
160
+ with:
161
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
162
+ flag-name: run-${{ matrix.ruby }}-${{ matrix.activerecord }}-${{ matrix.db }}-${{ matrix.dbversion }}
163
+ parallel: true
164
+ finish:
165
+ needs: test
166
+ runs-on: ubuntu-latest
167
+ steps:
168
+ - name: Coveralls Finished
169
+ if: "${{ !env.ACT }}"
170
+ uses: coverallsapp/github-action@master
171
+ with:
172
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
173
+ parallel-finished: true
data/.gitignore CHANGED
@@ -2,6 +2,7 @@
2
2
  /tmp
3
3
  /pkg
4
4
  /Gemfile.local
5
+ /.idea
5
6
 
6
7
  .byebug_history
7
8
  *.lock
data/.simplecov ADDED
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ SimpleCov.configure do
4
+ enable_coverage :branch
5
+ add_filter '/spec/'
6
+
7
+ add_group 'Binaries', '/bin/'
8
+ add_group 'Libraries', '/lib/'
9
+
10
+ if ENV['CI']
11
+ require 'simplecov-lcov'
12
+
13
+ SimpleCov::Formatter::LcovFormatter.config do |c|
14
+ c.report_with_single_file = true
15
+ c.single_report_path = 'coverage/lcov.info'
16
+ end
17
+
18
+ formatter SimpleCov::Formatter::LcovFormatter
19
+ end
20
+ end
data/Gemfile CHANGED
@@ -1,5 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "http://rubygems.org"
2
4
 
3
5
  gemspec
4
6
 
5
- File.exist?(gemfile_local = File.expand_path('../Gemfile.local', __FILE__)) and eval File.read(gemfile_local), binding, gemfile_local
7
+ gemfile_local = File.expand_path '../Gemfile.local', __FILE__
8
+ eval File.read(gemfile_local), binding, gemfile_local if File.exist? gemfile_local
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/schema_plus_core.svg)](http://badge.fury.io/rb/schema_plus_core)
2
- [![Build Status](https://travis-ci.org/SchemaPlus/schema_plus_core.svg?branch=master)](http://travis-ci.org/SchemaPlus/schema_plus_core)
2
+ [![Build Status](https://github.com/SchemaPlus/schema_plus_core/actions/workflows/prs.yml/badge.svg)](https://github.com/SchemaPlus/schema_plus_core/actions)
3
3
  [![Coverage Status](https://img.shields.io/coveralls/SchemaPlus/schema_plus_core.svg)](https://coveralls.io/r/SchemaPlus/schema_plus_core)
4
4
 
5
5
  # SchemaPlus::Core
@@ -23,12 +23,19 @@ SchemaPlus::Core is tested on:
23
23
 
24
24
  <!-- SCHEMA_DEV: MATRIX - begin -->
25
25
  <!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
26
- * ruby **2.4.4** with activerecord **5.0**, using **mysql2**, **sqlite3** or **postgresql**
27
- * ruby **2.4.4** with activerecord **5.1**, using **mysql2**, **sqlite3** or **postgresql**
28
- * ruby **2.4.4** with activerecord **5.2**, using **mysql2**, **sqlite3** or **postgresql**
29
- * ruby **2.5.1** with activerecord **5.0**, using **mysql2**, **sqlite3** or **postgresql**
30
- * ruby **2.5.1** with activerecord **5.1**, using **mysql2**, **sqlite3** or **postgresql**
31
- * ruby **2.5.1** with activerecord **5.2**, using **mysql2**, **sqlite3** or **postgresql**
26
+ * ruby **2.5** with activerecord **5.2**, using **postgresql:9.6**, **mysql2** or **sqlite3**
27
+ * ruby **2.5** with activerecord **6.0**, using **postgresql:9.6**, **mysql2** or **sqlite3**
28
+ * ruby **2.5** with activerecord **6.1**, using **postgresql:9.6**, **mysql2** or **sqlite3**
29
+ * ruby **2.7** with activerecord **5.2**, using **postgresql:9.6**, **mysql2** or **sqlite3**
30
+ * ruby **2.7** with activerecord **6.0**, using **postgresql:9.6**, **mysql2** or **sqlite3**
31
+ * ruby **2.7** with activerecord **6.1**, using **postgresql:9.6**, **mysql2** or **sqlite3**
32
+ * ruby **2.7** with activerecord **7.0**, using **postgresql:9.6**, **mysql2** or **sqlite3**
33
+ * ruby **3.0** with activerecord **6.0**, using **postgresql:9.6**, **mysql2** or **sqlite3**
34
+ * ruby **3.0** with activerecord **6.1**, using **postgresql:9.6**, **mysql2** or **sqlite3**
35
+ * ruby **3.0** with activerecord **7.0**, using **postgresql:9.6**, **mysql2** or **sqlite3**
36
+ * ruby **3.1** with activerecord **6.0**, using **postgresql:9.6**, **mysql2** or **sqlite3**
37
+ * ruby **3.1** with activerecord **6.1**, using **postgresql:9.6**, **mysql2** or **sqlite3**
38
+ * ruby **3.1** with activerecord **7.0**, using **postgresql:9.6**, **mysql2** or **sqlite3**
32
39
 
33
40
  <!-- SCHEMA_DEV: MATRIX - end -->
34
41
 
@@ -444,28 +451,30 @@ SchemaPlus::Core provides a state object and of callbacks to various phases of t
444
451
 
445
452
  ## Release Notes
446
453
 
447
- * 2.2.3 Fix dumping complex expression based indexes in AR 5.x
448
- * 2.2.2 Fixed dumping tables in postgresql in AR 5.2 when the PK is not a bigint.
449
- * 2.2.1 Fixed expression index handling in AR5.x.
450
- * 2.2.0 Added AR5.2 support. Thanks to [@jeremyyap](https://github.com/jeremyyap)
451
- * 2.1.1 Bug fix: Don't lose habtm options. Thanks to [@iagopiimenta ](https://github.com/iagopiimenta)
452
- * 2.1.0 Added AR5.1 support. Thanks to [@iagopiimenta ](https://github.com/iagopiimenta)
453
- * 2.0.1 Tighten up AR dependency. Thanks to [@myabc](https://github.com/myabc).
454
- * 2.0.0 Added AR5 support, removed AR4.2 support. Thanks to [@boazy](https://github.com/boazy).
455
- * 1.0.2 Missing require
456
- * 1.0.1 Explicit gem dependencies
457
- * 1.0.0 Clean up `SchemaDump::Table::Column` and `SchemaDump::Table::Index` API: `#options` is now a hash and `#comments` is now an array; no longer have `add_option` and `add_comment` methods.
458
- * 0.6.2 Bug fix: don't choke on INHERITANCE in table definition (#7). Thanks to [@ADone](https://github.com/ADone).
459
- * 0.6.1 Make sure to require pathname (#5)
460
- * 0.6.0 Added `table.alt` to dumper; Bug fix: Don't crash when AR fails to dump a table. Thanks to [@stenver](https://github.com/stenver) for tracking it down
461
- * 0.5.1 Bug fix: Don't choke on a quoted newline in a `CREATE TABLE` statement ([#3](https://github.com/SchemaPlus/schema_plus_core/pull/3)). Thanks to [@mikeauclair](https://github.com/mikeauclair)
462
- * 0.5.0 Added `Migration::DropTable`
463
- * 0.4.0 Added `implements_reference` to `Migration::Column` stack env
464
- * 0.3.1 Pass along (undocumented) return values from association declarations ([#2](https://github.com/SchemaPlus/schema_plus_core/pull/2)). Thanks to [@lowjoel](https://github.com/lowjoel)
465
- * 0.3.0 Added `Model::Association::Declaration` ([#1](https://github.com/SchemaPlus/schema_plus_core/pull/1)). Thanks to [@lowjoel](https://github.com/lowjoel).
466
- * 0.2.1 Added `Migration::CreateTable` and `Schema::Define`; removed dependency on (defunct) `schema_monkey_rails` gem. [Oops, this should have been a minor version bump]
467
- * 0.2.0 Added `Migration::DropTable`
468
- * 0.1.0 Initial release
454
+ * **3.1.0** Add AR 6.1 and 7.0, add Ruby 3.1
455
+ * **3.0.0** Drop AR < 5.2 and add AR 6.0 support. Drop Ruby < 2.5 and add Ruby 3.0 support.
456
+ * **2.2.3** Fix dumping complex expression based indexes in AR 5.x
457
+ * **2.2.2** Fixed dumping tables in postgresql in AR 5.2 when the PK is not a bigint.
458
+ * **2.2.1** Fixed expression index handling in AR5.x.
459
+ * **2.2.0** Added AR5.2 support. Thanks to [@jeremyyap](https://github.com/jeremyyap)
460
+ * **2.1.1** Bug fix: Don't lose habtm options. Thanks to [@iagopiimenta ](https://github.com/iagopiimenta)
461
+ * **2.1.0** Added AR5.1 support. Thanks to [@iagopiimenta ](https://github.com/iagopiimenta)
462
+ * **2.0.1** Tighten up AR dependency. Thanks to [@myabc](https://github.com/myabc).
463
+ * **2.0.0** Added AR5 support, removed AR4.2 support. Thanks to [@boazy](https://github.com/boazy).
464
+ * **1.0.2** Missing require
465
+ * **1.0.1** Explicit gem dependencies
466
+ * **1.0.0** Clean up `SchemaDump::Table::Column` and `SchemaDump::Table::Index` API: `#options` is now a hash and `#comments` is now an array; no longer have `add_option` and `add_comment` methods.
467
+ * **0.6.2** Bug fix: don't choke on INHERITANCE in table definition (#7). Thanks to [@ADone](https://github.com/ADone).
468
+ * **0.6.1** Make sure to require pathname (#5)
469
+ * **0.6.0** Added `table.alt` to dumper; Bug fix: Don't crash when AR fails to dump a table. Thanks to [@stenver](https://github.com/stenver) for tracking it down
470
+ * **0.5.1** Bug fix: Don't choke on a quoted newline in a `CREATE TABLE` statement ([#3](https://github.com/SchemaPlus/schema_plus_core/pull/3)). Thanks to [@mikeauclair](https://github.com/mikeauclair)
471
+ * **0.5.0** Added `Migration::DropTable`
472
+ * **0.4.0** Added `implements_reference` to `Migration::Column` stack env
473
+ * **0.3.1** Pass along (undocumented) return values from association declarations ([#2](https://github.com/SchemaPlus/schema_plus_core/pull/2)). Thanks to [@lowjoel](https://github.com/lowjoel)
474
+ * **0.3.0** Added `Model::Association::Declaration` ([#1](https://github.com/SchemaPlus/schema_plus_core/pull/1)). Thanks to [@lowjoel](https://github.com/lowjoel).
475
+ * **0.2.1** Added `Migration::CreateTable` and `Schema::Define`; removed dependency on (defunct) `schema_monkey_rails` gem. [Oops, this should have been a minor version bump]
476
+ * **0.2.0** Added `Migration::DropTable`
477
+ * **0.1.0** Initial release
469
478
 
470
479
  ## Development & Testing
471
480
 
@@ -478,7 +487,7 @@ Some things to know about to help you develop and test:
478
487
  * **schema_dev**: SchemaPlus::Core uses [schema_dev](https://github.com/SchemaPlus/schema_dev) to
479
488
  facilitate running rspec tests on the matrix of ruby, activerecord, and database
480
489
  versions that the gem supports, both locally and on
481
- [travis-ci](http://travis-ci.org/SchemaPlus/schema_plus_core)
490
+ [github actions](https://github.com/SchemaPlus/schema_plus_core/actions)
482
491
 
483
492
  To to run rspec locally on the full matrix, do:
484
493
 
@@ -490,7 +499,6 @@ Some things to know about to help you develop and test:
490
499
  The matrix of configurations is specified in `schema_dev.yml` in
491
500
  the project root.
492
501
 
493
-
494
502
  <!-- SCHEMA_DEV: TEMPLATE USES SCHEMA_DEV - end -->
495
503
 
496
504
  <!-- SCHEMA_DEV: TEMPLATE USES SCHEMA_MONKEY - begin -->
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler'
2
4
  Bundler::GemHelper.install_tasks
3
5
 
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
- gemspec :path => File.expand_path('..', __FILE__)
2
+ gemspec path: File.expand_path('..', __FILE__)
3
3
 
4
4
  File.exist?(gemfile_local = File.expand_path('../Gemfile.local', __FILE__)) and eval File.read(gemfile_local), binding, gemfile_local
@@ -1,3 +1,4 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
2
3
 
3
4
  gem "activerecord", ">= 5.2.0.beta0", "< 5.3"
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "mysql2"
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "pg"
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "sqlite3"
@@ -7,4 +7,4 @@ end
7
7
 
8
8
  platform :jruby do
9
9
  gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
- end
10
+ end
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 6.0", "< 6.1"
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "sqlite3"
@@ -7,4 +7,4 @@ end
7
7
 
8
8
  platform :jruby do
9
9
  gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
- end
10
+ end
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 6.1", "< 6.2"
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "sqlite3"
@@ -7,4 +7,4 @@ end
7
7
 
8
8
  platform :jruby do
9
9
  gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
- end
10
+ end
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 7.0", "< 7.1"
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "sqlite3"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaPlus
2
4
  module Core
3
5
  module ActiveRecord
@@ -22,25 +24,25 @@ module SchemaPlus
22
24
  # relies on the undocumented return value.
23
25
  def has_many(name, scope = nil, **options, &extension)
24
26
  SchemaMonkey::Middleware::Model::Association::Declaration.start(model: self, name: name, scope: scope, options: options, extension: extension) do |env|
25
- env.result = super(env.name, env.scope, env.options, &env.extension)
27
+ env.result = super(env.name, env.scope, **env.options, &env.extension)
26
28
  end.result
27
29
  end
28
30
 
29
31
  def has_one(name, scope = nil, **options, &extension)
30
32
  SchemaMonkey::Middleware::Model::Association::Declaration.start(model: self, name: name, scope: scope, options: options, extension: extension) do |env|
31
- env.result = super(env.name, env.scope, env.options, &env.extension)
33
+ env.result = super(env.name, env.scope, **env.options, &env.extension)
32
34
  end.result
33
35
  end
34
36
 
35
37
  def has_and_belongs_to_many(name, scope = nil, **options, &extension)
36
38
  SchemaMonkey::Middleware::Model::Association::Declaration.start(model: self, name: name, scope: scope, options: options, extension: extension) do |env|
37
- env.result = super(env.name, env.scope, env.options, &env.extension)
39
+ env.result = super(env.name, env.scope, **env.options, &env.extension)
38
40
  end.result
39
41
  end
40
42
 
41
43
  def belongs_to(name, scope = nil, **options, &extension)
42
44
  SchemaMonkey::Middleware::Model::Association::Declaration.start(model: self, name: name, scope: scope, options: options, extension: extension) do |env|
43
- env.result = super(env.name, env.scope, env.options, &env.extension)
45
+ env.result = super(env.name, env.scope, **env.options, &env.extension)
44
46
  end.result
45
47
  end
46
48
  end