edge_rider 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +6 -1
- data/CHANGELOG.md +9 -1
- data/Gemfile.4.2.mysql2 +1 -0
- data/Gemfile.4.2.mysql2.lock +6 -2
- data/Gemfile.4.2.pg +1 -0
- data/Gemfile.4.2.pg.lock +6 -2
- data/Gemfile.5.2.mysql2 +1 -0
- data/Gemfile.5.2.mysql2.lock +6 -2
- data/Gemfile.5.2.pg +1 -0
- data/Gemfile.5.2.pg.lock +6 -2
- data/Gemfile.6.1.pg +1 -0
- data/Gemfile.6.1.pg.lock +6 -2
- data/Gemfile.7.0.pg +17 -0
- data/Gemfile.7.0.pg.lock +78 -0
- data/README.md +1 -1
- data/edge_rider.gemspec +1 -0
- data/lib/edge_rider/preload_associations.rb +9 -14
- data/lib/edge_rider/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 92243002f87dbe03f00014b107beb57f9e024b9f77b3d16f134e20532e8c3c7e
|
|
4
|
+
data.tar.gz: f18dd9916e2226870cc2ff97fa64437097df10ef18c2b548a2c7f98d32a9633d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5056092d3c444feab3997beeb2f6278ce260f1690c1a78517cecbb278ccb3c0811d4578f2eba66a80553391df86c29964ba2ab66fc09c2bfff34fe06cc8e1b0
|
|
7
|
+
data.tar.gz: a39f21a754769f355cf1ee76d3261e0556096d0d600468e604e4dc66a7203922c0387bc506cd586626bc40b0bad079ddf5b2c921f43c17e18bd2f23d380f02d3
|
data/.github/workflows/test.yml
CHANGED
|
@@ -41,7 +41,8 @@ jobs:
|
|
|
41
41
|
ruby-version: "${{ matrix.ruby }}"
|
|
42
42
|
- name: Setup database
|
|
43
43
|
run: |
|
|
44
|
-
sudo apt-get
|
|
44
|
+
sudo apt-get update
|
|
45
|
+
sudo apt-get install -y mariadb-client libmariadbclient-dev
|
|
45
46
|
mysql -e 'create database IF NOT EXISTS test;' -u root --password=password -P 3306 -h 127.0.0.1
|
|
46
47
|
- name: Bundle
|
|
47
48
|
run: |
|
|
@@ -79,6 +80,10 @@ jobs:
|
|
|
79
80
|
gemfile: Gemfile.6.1.pg
|
|
80
81
|
- ruby: 3.0.2
|
|
81
82
|
gemfile: Gemfile.6.1.pg
|
|
83
|
+
- ruby: 2.7.4
|
|
84
|
+
gemfile: Gemfile.7.0.pg
|
|
85
|
+
- ruby: 3.0.2
|
|
86
|
+
gemfile: Gemfile.7.0.pg
|
|
82
87
|
env:
|
|
83
88
|
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
|
84
89
|
steps:
|
data/CHANGELOG.md
CHANGED
|
@@ -10,10 +10,18 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
|
10
10
|
### Compatible changes
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## 2.1.0 - 2022-02-24
|
|
14
|
+
|
|
15
|
+
### Compatible changes
|
|
16
|
+
- Add support for Rails 7.0
|
|
17
|
+
- Activate Rubygems MFA
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## 2.0.0 - 2021-08-24
|
|
14
21
|
|
|
15
22
|
### Breaking changes
|
|
16
23
|
- Drop support for Ruby < 2.5.0
|
|
24
|
+
- Drop support for Rails < 3.2
|
|
17
25
|
|
|
18
26
|
### Compatible changes
|
|
19
27
|
- Add support for Rails 6.1
|
data/Gemfile.4.2.mysql2
CHANGED
data/Gemfile.4.2.mysql2.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
edge_rider (2.
|
|
4
|
+
edge_rider (2.1.0)
|
|
5
5
|
activerecord (>= 3.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -25,6 +25,9 @@ GEM
|
|
|
25
25
|
coderay (1.1.2)
|
|
26
26
|
concurrent-ruby (1.1.9)
|
|
27
27
|
database_cleaner (1.0.1)
|
|
28
|
+
db-query-matchers (0.10.0)
|
|
29
|
+
activesupport (>= 4.0, < 7)
|
|
30
|
+
rspec (~> 3.0)
|
|
28
31
|
diff-lcs (1.2.5)
|
|
29
32
|
gemika (0.6.1)
|
|
30
33
|
has_defaults (0.4.4)
|
|
@@ -64,6 +67,7 @@ PLATFORMS
|
|
|
64
67
|
DEPENDENCIES
|
|
65
68
|
activerecord (~> 4.2.0)
|
|
66
69
|
database_cleaner
|
|
70
|
+
db-query-matchers
|
|
67
71
|
edge_rider!
|
|
68
72
|
gemika (>= 0.5.0)
|
|
69
73
|
has_defaults
|
|
@@ -73,4 +77,4 @@ DEPENDENCIES
|
|
|
73
77
|
rspec
|
|
74
78
|
|
|
75
79
|
BUNDLED WITH
|
|
76
|
-
2.2.
|
|
80
|
+
2.2.32
|
data/Gemfile.4.2.pg
CHANGED
data/Gemfile.4.2.pg.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
edge_rider (2.
|
|
4
|
+
edge_rider (2.1.0)
|
|
5
5
|
activerecord (>= 3.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -25,6 +25,9 @@ GEM
|
|
|
25
25
|
coderay (1.1.2)
|
|
26
26
|
concurrent-ruby (1.1.9)
|
|
27
27
|
database_cleaner (1.5.3)
|
|
28
|
+
db-query-matchers (0.10.0)
|
|
29
|
+
activesupport (>= 4.0, < 7)
|
|
30
|
+
rspec (~> 3.0)
|
|
28
31
|
diff-lcs (1.2.5)
|
|
29
32
|
gemika (0.6.1)
|
|
30
33
|
has_defaults (0.4.4)
|
|
@@ -64,6 +67,7 @@ PLATFORMS
|
|
|
64
67
|
DEPENDENCIES
|
|
65
68
|
activerecord (~> 4.2.0)
|
|
66
69
|
database_cleaner
|
|
70
|
+
db-query-matchers
|
|
67
71
|
edge_rider!
|
|
68
72
|
gemika (>= 0.5.0)
|
|
69
73
|
has_defaults
|
|
@@ -73,4 +77,4 @@ DEPENDENCIES
|
|
|
73
77
|
rspec
|
|
74
78
|
|
|
75
79
|
BUNDLED WITH
|
|
76
|
-
2.2.
|
|
80
|
+
2.2.32
|
data/Gemfile.5.2.mysql2
CHANGED
data/Gemfile.5.2.mysql2.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
edge_rider (2.
|
|
4
|
+
edge_rider (2.1.0)
|
|
5
5
|
activerecord (>= 3.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -23,6 +23,9 @@ GEM
|
|
|
23
23
|
coderay (1.1.2)
|
|
24
24
|
concurrent-ruby (1.1.5)
|
|
25
25
|
database_cleaner (1.6.1)
|
|
26
|
+
db-query-matchers (0.10.0)
|
|
27
|
+
activesupport (>= 4.0, < 7)
|
|
28
|
+
rspec (~> 3.0)
|
|
26
29
|
diff-lcs (1.3)
|
|
27
30
|
gemika (0.5.0)
|
|
28
31
|
has_defaults (0.4.4)
|
|
@@ -62,6 +65,7 @@ PLATFORMS
|
|
|
62
65
|
DEPENDENCIES
|
|
63
66
|
activerecord (~> 5.2.3)
|
|
64
67
|
database_cleaner
|
|
68
|
+
db-query-matchers
|
|
65
69
|
edge_rider!
|
|
66
70
|
gemika (>= 0.5.0)
|
|
67
71
|
has_defaults
|
|
@@ -72,4 +76,4 @@ DEPENDENCIES
|
|
|
72
76
|
rspec
|
|
73
77
|
|
|
74
78
|
BUNDLED WITH
|
|
75
|
-
2.2.
|
|
79
|
+
2.2.32
|
data/Gemfile.5.2.pg
CHANGED
data/Gemfile.5.2.pg.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
edge_rider (2.
|
|
4
|
+
edge_rider (2.1.0)
|
|
5
5
|
activerecord (>= 3.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -23,6 +23,9 @@ GEM
|
|
|
23
23
|
coderay (1.1.2)
|
|
24
24
|
concurrent-ruby (1.1.5)
|
|
25
25
|
database_cleaner (1.6.1)
|
|
26
|
+
db-query-matchers (0.10.0)
|
|
27
|
+
activesupport (>= 4.0, < 7)
|
|
28
|
+
rspec (~> 3.0)
|
|
26
29
|
diff-lcs (1.3)
|
|
27
30
|
gemika (0.5.0)
|
|
28
31
|
has_defaults (0.4.4)
|
|
@@ -62,6 +65,7 @@ PLATFORMS
|
|
|
62
65
|
DEPENDENCIES
|
|
63
66
|
activerecord (~> 5.2.3)
|
|
64
67
|
database_cleaner
|
|
68
|
+
db-query-matchers
|
|
65
69
|
edge_rider!
|
|
66
70
|
gemika (>= 0.5.0)
|
|
67
71
|
has_defaults
|
|
@@ -72,4 +76,4 @@ DEPENDENCIES
|
|
|
72
76
|
rspec
|
|
73
77
|
|
|
74
78
|
BUNDLED WITH
|
|
75
|
-
2.2.
|
|
79
|
+
2.2.32
|
data/Gemfile.6.1.pg
CHANGED
data/Gemfile.6.1.pg.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
edge_rider (2.
|
|
4
|
+
edge_rider (2.1.0)
|
|
5
5
|
activerecord (>= 3.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -27,6 +27,9 @@ GEM
|
|
|
27
27
|
activerecord (>= 5.a)
|
|
28
28
|
database_cleaner-core (~> 2.0.0)
|
|
29
29
|
database_cleaner-core (2.0.1)
|
|
30
|
+
db-query-matchers (0.10.0)
|
|
31
|
+
activesupport (>= 4.0, < 7)
|
|
32
|
+
rspec (~> 3.0)
|
|
30
33
|
diff-lcs (1.4.4)
|
|
31
34
|
gemika (0.5.0)
|
|
32
35
|
has_defaults (0.4.4)
|
|
@@ -66,6 +69,7 @@ PLATFORMS
|
|
|
66
69
|
DEPENDENCIES
|
|
67
70
|
activerecord (~> 6.1.3)
|
|
68
71
|
database_cleaner
|
|
72
|
+
db-query-matchers
|
|
69
73
|
edge_rider!
|
|
70
74
|
gemika (>= 0.5.0)
|
|
71
75
|
has_defaults
|
|
@@ -75,4 +79,4 @@ DEPENDENCIES
|
|
|
75
79
|
rspec
|
|
76
80
|
|
|
77
81
|
BUNDLED WITH
|
|
78
|
-
2.
|
|
82
|
+
2.3.4
|
data/Gemfile.7.0.pg
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# Runtime dependencies
|
|
4
|
+
gem 'activerecord', '~>7.0.1'
|
|
5
|
+
gem 'pg'
|
|
6
|
+
|
|
7
|
+
# Development dependencies
|
|
8
|
+
gem 'rake'
|
|
9
|
+
gem 'database_cleaner'
|
|
10
|
+
gem 'has_defaults' # used by test models
|
|
11
|
+
gem 'rspec'
|
|
12
|
+
gem 'gemika', '>=0.5.0'
|
|
13
|
+
gem 'pry-byebug'
|
|
14
|
+
gem 'db-query-matchers'
|
|
15
|
+
|
|
16
|
+
# Gem under test
|
|
17
|
+
gem 'edge_rider', path: '.'
|
data/Gemfile.7.0.pg.lock
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
edge_rider (2.1.0)
|
|
5
|
+
activerecord (>= 3.2)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
activemodel (7.0.1)
|
|
11
|
+
activesupport (= 7.0.1)
|
|
12
|
+
activerecord (7.0.1)
|
|
13
|
+
activemodel (= 7.0.1)
|
|
14
|
+
activesupport (= 7.0.1)
|
|
15
|
+
activesupport (7.0.1)
|
|
16
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
17
|
+
i18n (>= 1.6, < 2)
|
|
18
|
+
minitest (>= 5.1)
|
|
19
|
+
tzinfo (~> 2.0)
|
|
20
|
+
byebug (11.1.3)
|
|
21
|
+
coderay (1.1.3)
|
|
22
|
+
concurrent-ruby (1.1.9)
|
|
23
|
+
database_cleaner (2.0.1)
|
|
24
|
+
database_cleaner-active_record (~> 2.0.0)
|
|
25
|
+
database_cleaner-active_record (2.0.1)
|
|
26
|
+
activerecord (>= 5.a)
|
|
27
|
+
database_cleaner-core (~> 2.0.0)
|
|
28
|
+
database_cleaner-core (2.0.1)
|
|
29
|
+
db-query-matchers (0.8.0)
|
|
30
|
+
diff-lcs (1.5.0)
|
|
31
|
+
gemika (0.6.1)
|
|
32
|
+
has_defaults (1.0.0)
|
|
33
|
+
activerecord
|
|
34
|
+
i18n (1.8.11)
|
|
35
|
+
concurrent-ruby (~> 1.0)
|
|
36
|
+
method_source (1.0.0)
|
|
37
|
+
minitest (5.15.0)
|
|
38
|
+
pg (1.2.3)
|
|
39
|
+
pry (0.13.1)
|
|
40
|
+
coderay (~> 1.1)
|
|
41
|
+
method_source (~> 1.0)
|
|
42
|
+
pry-byebug (3.9.0)
|
|
43
|
+
byebug (~> 11.0)
|
|
44
|
+
pry (~> 0.13.0)
|
|
45
|
+
rake (13.0.6)
|
|
46
|
+
rspec (3.10.0)
|
|
47
|
+
rspec-core (~> 3.10.0)
|
|
48
|
+
rspec-expectations (~> 3.10.0)
|
|
49
|
+
rspec-mocks (~> 3.10.0)
|
|
50
|
+
rspec-core (3.10.1)
|
|
51
|
+
rspec-support (~> 3.10.0)
|
|
52
|
+
rspec-expectations (3.10.1)
|
|
53
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
54
|
+
rspec-support (~> 3.10.0)
|
|
55
|
+
rspec-mocks (3.10.2)
|
|
56
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
57
|
+
rspec-support (~> 3.10.0)
|
|
58
|
+
rspec-support (3.10.3)
|
|
59
|
+
tzinfo (2.0.4)
|
|
60
|
+
concurrent-ruby (~> 1.0)
|
|
61
|
+
|
|
62
|
+
PLATFORMS
|
|
63
|
+
x86_64-linux
|
|
64
|
+
|
|
65
|
+
DEPENDENCIES
|
|
66
|
+
activerecord (~> 7.0.1)
|
|
67
|
+
database_cleaner
|
|
68
|
+
db-query-matchers
|
|
69
|
+
edge_rider!
|
|
70
|
+
gemika (>= 0.5.0)
|
|
71
|
+
has_defaults
|
|
72
|
+
pg
|
|
73
|
+
pry-byebug
|
|
74
|
+
rake
|
|
75
|
+
rspec
|
|
76
|
+
|
|
77
|
+
BUNDLED WITH
|
|
78
|
+
2.3.4
|
data/README.md
CHANGED
|
@@ -235,7 +235,7 @@ Now run `bundle install` and restart your server.
|
|
|
235
235
|
## Development
|
|
236
236
|
|
|
237
237
|
- There are tests in `spec`. We only accept PRs with tests.
|
|
238
|
-
- We currently develop using the Ruby version in `.ruby-version`. It is required to change the Ruby Version to cover all Rails version or just use
|
|
238
|
+
- We currently develop using the Ruby version in `.ruby-version`. It is required to change the Ruby Version to cover all Rails version or just use Github Actions.
|
|
239
239
|
- Put your database credentials into `spec/support/database.yml`. There's a `database.sample.yml` you can use as a template.
|
|
240
240
|
- Create a database `edge_rider_test` in both MySQL and PostgreSQL.
|
|
241
241
|
- There are gem bundles in the project root for each combination of ActiveRecord version and database type that we support.
|
data/edge_rider.gemspec
CHANGED
|
@@ -13,6 +13,7 @@ Gem::Specification.new do |spec|
|
|
|
13
13
|
spec.description = spec.summary
|
|
14
14
|
spec.homepage = 'https://github.com/makandra/edge_rider'
|
|
15
15
|
spec.license = 'MIT'
|
|
16
|
+
spec.metadata = { 'rubygems_mfa_required' => 'true' }
|
|
16
17
|
|
|
17
18
|
# Specify which files should be added to the gem when it is released.
|
|
18
19
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
@@ -9,24 +9,19 @@ module EdgeRider
|
|
|
9
9
|
def preload_associations(*args)
|
|
10
10
|
preloader = ActiveRecord::Associations::Preloader
|
|
11
11
|
|
|
12
|
-
if preloader.method_defined?(:
|
|
13
|
-
preloader.new.preload(*args)
|
|
14
|
-
else
|
|
12
|
+
if preloader.method_defined?(:run) # Rails 3.2 / Rails 4
|
|
15
13
|
preloader.new(*args).run
|
|
14
|
+
elsif preloader.method_defined?(:preload) # Rails 5 to Rails 6.1
|
|
15
|
+
preloader.new.preload(*args)
|
|
16
|
+
else # Rails 7+
|
|
17
|
+
records = args.first
|
|
18
|
+
associations = args.second
|
|
19
|
+
options = args[2] || {}
|
|
20
|
+
preloader.new(records: records, associations: associations, **options).call
|
|
16
21
|
end
|
|
17
22
|
end
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
ActiveRecord::Base.class_eval do
|
|
21
|
-
class << self
|
|
22
|
-
public :preload_associations
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
else # Rails 3.2+
|
|
26
|
-
ActiveRecord::Base.send(:extend, self)
|
|
27
|
-
end
|
|
28
|
-
|
|
24
|
+
ActiveRecord::Base.send(:extend, self)
|
|
29
25
|
ActiveRecord::Base.send(:include, PreloadAssociationsInstanceMethod)
|
|
30
|
-
|
|
31
26
|
end
|
|
32
27
|
end
|
data/lib/edge_rider/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: edge_rider
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Henning Koch
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-03-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
@@ -47,6 +47,8 @@ files:
|
|
|
47
47
|
- Gemfile.5.2.pg.lock
|
|
48
48
|
- Gemfile.6.1.pg
|
|
49
49
|
- Gemfile.6.1.pg.lock
|
|
50
|
+
- Gemfile.7.0.pg
|
|
51
|
+
- Gemfile.7.0.pg.lock
|
|
50
52
|
- Gemfile.lock
|
|
51
53
|
- LICENSE
|
|
52
54
|
- README.md
|
|
@@ -66,7 +68,8 @@ files:
|
|
|
66
68
|
homepage: https://github.com/makandra/edge_rider
|
|
67
69
|
licenses:
|
|
68
70
|
- MIT
|
|
69
|
-
metadata:
|
|
71
|
+
metadata:
|
|
72
|
+
rubygems_mfa_required: 'true'
|
|
70
73
|
post_install_message:
|
|
71
74
|
rdoc_options: []
|
|
72
75
|
require_paths:
|
|
@@ -82,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
82
85
|
- !ruby/object:Gem::Version
|
|
83
86
|
version: '0'
|
|
84
87
|
requirements: []
|
|
85
|
-
rubygems_version: 3.2.
|
|
88
|
+
rubygems_version: 3.2.32
|
|
86
89
|
signing_key:
|
|
87
90
|
specification_version: 4
|
|
88
91
|
summary: Power tools for ActiveRecord relations (scopes)
|