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.
- checksums.yaml +4 -4
- data/.github/workflows/prs.yml +173 -0
- data/.gitignore +1 -0
- data/.simplecov +20 -0
- data/Gemfile +4 -1
- data/README.md +39 -31
- data/Rakefile +2 -0
- data/gemfiles/Gemfile.base +1 -1
- data/gemfiles/activerecord-5.2/Gemfile.base +2 -1
- data/gemfiles/activerecord-5.2/Gemfile.mysql2 +2 -2
- data/gemfiles/activerecord-5.2/Gemfile.postgresql +2 -2
- data/gemfiles/activerecord-5.2/Gemfile.sqlite3 +3 -3
- data/gemfiles/activerecord-6.0/Gemfile.base +4 -0
- data/gemfiles/activerecord-6.0/Gemfile.mysql2 +10 -0
- data/gemfiles/activerecord-6.0/Gemfile.postgresql +10 -0
- data/gemfiles/{activerecord-5.0 → activerecord-6.0}/Gemfile.sqlite3 +3 -3
- data/gemfiles/activerecord-6.1/Gemfile.base +4 -0
- data/gemfiles/activerecord-6.1/Gemfile.mysql2 +10 -0
- data/gemfiles/activerecord-6.1/Gemfile.postgresql +10 -0
- data/gemfiles/{activerecord-5.1 → activerecord-6.1}/Gemfile.sqlite3 +3 -3
- data/gemfiles/activerecord-7.0/Gemfile.base +4 -0
- data/gemfiles/activerecord-7.0/Gemfile.mysql2 +10 -0
- data/gemfiles/activerecord-7.0/Gemfile.postgresql +10 -0
- data/gemfiles/activerecord-7.0/Gemfile.sqlite3 +10 -0
- data/lib/schema_plus/core/active_record/base.rb +6 -4
- data/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb +65 -26
- data/lib/schema_plus/core/active_record/connection_adapters/mysql2_adapter.rb +17 -7
- data/lib/schema_plus/core/active_record/connection_adapters/postgresql/schema_dumper.rb +11 -5
- data/lib/schema_plus/core/active_record/connection_adapters/postgresql_adapter.rb +24 -32
- data/lib/schema_plus/core/active_record/connection_adapters/sqlite3_adapter.rb +15 -5
- data/lib/schema_plus/core/active_record/connection_adapters/table_definition.rb +18 -10
- data/lib/schema_plus/core/active_record/migration/command_recorder.rb +4 -2
- data/lib/schema_plus/core/active_record/schema.rb +2 -0
- data/lib/schema_plus/core/active_record/schema_dumper.rb +16 -2
- data/lib/schema_plus/core/middleware.rb +3 -1
- data/lib/schema_plus/core/schema_dump.rb +14 -5
- data/lib/schema_plus/core/sql_struct.rb +4 -2
- data/lib/schema_plus/core/version.rb +3 -1
- data/lib/schema_plus/core.rb +4 -4
- data/schema_dev.yml +8 -5
- data/schema_plus_core.gemspec +9 -10
- data/spec/column_spec.rb +3 -2
- data/spec/dumper_spec.rb +19 -9
- data/spec/index_spec.rb +2 -0
- data/spec/middleware_spec.rb +5 -2
- data/spec/spec_helper.rb +4 -9
- data/spec/sql_struct_spec.rb +2 -0
- data/spec/support/enableable.rb +2 -4
- data/spec/support/test_reporter.rb +3 -1
- metadata +41 -87
- data/.travis.yml +0 -25
- data/gemfiles/activerecord-5.0/Gemfile.base +0 -3
- data/gemfiles/activerecord-5.0/Gemfile.mysql2 +0 -10
- data/gemfiles/activerecord-5.0/Gemfile.postgresql +0 -10
- data/gemfiles/activerecord-5.1/Gemfile.base +0 -3
- data/gemfiles/activerecord-5.1/Gemfile.mysql2 +0 -10
- data/gemfiles/activerecord-5.1/Gemfile.postgresql +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e83e662240a2fb8ed6ac51990070859461834639acdc5a2234ab337a27994652
|
4
|
+
data.tar.gz: ade3a5b17dbe22a2c2a279aa0c4ff2caa6f3cc302322848c6196d4ce4cb42e74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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
|
-
|
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://
|
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.
|
27
|
-
* ruby **2.
|
28
|
-
* ruby **2.
|
29
|
-
* ruby **2.
|
30
|
-
* ruby **2.
|
31
|
-
* ruby **2.
|
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
|
-
*
|
448
|
-
*
|
449
|
-
* 2.2.
|
450
|
-
* 2.2.
|
451
|
-
* 2.
|
452
|
-
* 2.
|
453
|
-
* 2.
|
454
|
-
* 2.
|
455
|
-
*
|
456
|
-
*
|
457
|
-
* 1.0.
|
458
|
-
* 0.
|
459
|
-
* 0.
|
460
|
-
* 0.6.
|
461
|
-
* 0.
|
462
|
-
* 0.
|
463
|
-
* 0.
|
464
|
-
* 0.
|
465
|
-
* 0.
|
466
|
-
* 0.
|
467
|
-
* 0.
|
468
|
-
* 0.1.
|
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
|
-
[
|
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
data/gemfiles/Gemfile.base
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
eval
|
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
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
eval
|
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
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
eval
|
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
|
@@ -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
|