edge_rider 1.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.
Files changed (42) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test.yml +104 -0
  3. data/.rspec +1 -0
  4. data/.ruby-version +1 -1
  5. data/CHANGELOG.md +29 -5
  6. data/Gemfile +1 -0
  7. data/Gemfile.4.2.mysql2 +4 -2
  8. data/Gemfile.4.2.mysql2.lock +35 -21
  9. data/Gemfile.4.2.pg +3 -1
  10. data/Gemfile.4.2.pg.lock +33 -19
  11. data/Gemfile.5.2.mysql2 +4 -2
  12. data/Gemfile.5.2.mysql2.lock +21 -7
  13. data/Gemfile.5.2.pg +3 -1
  14. data/Gemfile.5.2.pg.lock +19 -5
  15. data/{Gemfile.6.0.pg → Gemfile.6.1.pg} +4 -2
  16. data/Gemfile.6.1.pg.lock +82 -0
  17. data/{Gemfile.3.2.mysql2 → Gemfile.7.0.pg} +7 -6
  18. data/Gemfile.7.0.pg.lock +78 -0
  19. data/Gemfile.lock +1 -0
  20. data/README.md +86 -60
  21. data/edge_rider.gemspec +25 -15
  22. data/lib/edge_rider/preload_associations.rb +15 -13
  23. data/lib/edge_rider/traverse_association.rb +7 -3
  24. data/lib/edge_rider/util.rb +1 -1
  25. data/lib/edge_rider/version.rb +1 -1
  26. metadata +19 -28
  27. data/.travis.yml +0 -63
  28. data/Gemfile.3.2.mysql2.lock +0 -62
  29. data/Gemfile.6.0.pg.lock +0 -64
  30. data/spec/edge_rider/collect_column_spec.rb +0 -85
  31. data/spec/edge_rider/collect_ids_spec.rb +0 -108
  32. data/spec/edge_rider/origin_class_spec.rb +0 -32
  33. data/spec/edge_rider/preload_associations_spec.rb +0 -15
  34. data/spec/edge_rider/scoped_spec.rb +0 -53
  35. data/spec/edge_rider/to_id_query_spec.rb +0 -29
  36. data/spec/edge_rider/traverse_association_spec.rb +0 -128
  37. data/spec/edge_rider/util_spec.rb +0 -5
  38. data/spec/spec_helper.rb +0 -12
  39. data/spec/support/database.rb +0 -34
  40. data/spec/support/database.sample.yml +0 -10
  41. data/spec/support/database.travis.yml +0 -9
  42. data/spec/support/models.rb +0 -88
@@ -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/Gemfile.lock ADDED
@@ -0,0 +1 @@
1
+ Gemfile.6.1.pg.lock
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- Edge Rider [![Build Status](https://secure.travis-ci.org/makandra/edge_rider.png?branch=master)](https://travis-ci.org/makandra/edge_rider)
2
- ====================================
1
+ # Edge Rider [![Tests](https://github.com/makandra/edge_rider/workflows/Tests/badge.svg)](https://github.com/makandra/edge_rider/actions)
3
2
 
4
- Power tools for ActiveRecord relations (scopes)
5
- -------------------------------------------------
3
+ ## Power tools for ActiveRecord relations (scopes)
6
4
 
7
5
  In ActiveRecord, relations (or scopes) allow you to construct complex queries piece-by-piece
8
6
  and then trigger a query or update at a precisely defined moment. If you write any kind
@@ -14,9 +12,7 @@ Edge Rider was created with two intents:
14
12
  2. Provide a stable API for working with relations across multiple versions of Rails (since
15
13
  Rails has a tradition of breaking details of its relation API every other release).
16
14
 
17
-
18
- Usage
19
- -----
15
+ ## Usage
20
16
 
21
17
  ### Traversing a relation along an association
22
18
 
@@ -25,20 +21,26 @@ returns a new relation by "pivoting" around a named association.
25
21
 
26
22
  Say we have a `Post` model and each `Post` belongs to an author:
27
23
 
28
- class Post < ActiveRecord::Base
29
- belongs_to :author
30
- end
31
-
24
+ ```ruby
25
+ class Post < ActiveRecord::Base
26
+ belongs_to :author
27
+ end
28
+ ```
29
+
32
30
  To turn a relation of posts into a relation of its authors:
33
31
 
34
- posts = Post.where(archived: false)
35
- authors = posts.traverse_association(:author)
36
-
32
+ ```ruby
33
+ posts = Post.where(archived: false)
34
+ authors = posts.traverse_association(:author)
35
+ ```
36
+
37
37
  You can traverse multiple associations in a single call.
38
38
  E.g. to turn a relation of posts into a relation of all posts of their authors:
39
39
 
40
- posts = Post.where(archived: false)
41
- posts_by_same_authors = posts.traverse_association(:author, :posts)
40
+ ```ruby
41
+ posts = Post.where(archived: false)
42
+ posts_by_same_authors = posts.traverse_association(:author, :posts)
43
+ ```
42
44
 
43
45
  *Implementation note:* The traversal is achieved internally by collecting all foreign keys in the current relation
44
46
  and return a new relation with an `IN(...)` query (which is very efficient even for many thousand keys).
@@ -56,8 +58,10 @@ its ID.
56
58
  Edge Rider has a better way. Your relations gain a method `#collect_ids` that will
57
59
  fetch all IDs in a single query without instantiating a single ActiveRecord object:
58
60
 
59
- posts = Post.where(archived: false)
60
- post_ids = posts.collect_ids
61
+ ```ruby
62
+ posts = Post.where(archived: false)
63
+ post_ids = posts.collect_ids
64
+ ```
61
65
 
62
66
  *Implementation note:* `#collect_ids` delegates to [`#pluck`](https://apidock.com/rails/ActiveRecord/Calculations/pluck),
63
67
  which can be used for the same purpose.
@@ -68,33 +72,39 @@ which can be used for the same purpose.
68
72
  When writing a method that filters by record IDs, you can make it more useful by accepting
69
73
  any kind of argument that can be turned into a list of IDs:
70
74
 
71
- Post.by_author(1)
72
- Post.by_author([1, 2, 3])
73
- Post.by_author(Author.find(1))
74
- Post.by_author([Author.find(1), Author.find(2)])
75
- Post.by_author(Author.active)
75
+ ```ruby
76
+ Post.by_author(1)
77
+ Post.by_author([1, 2, 3])
78
+ Post.by_author(Author.find(1))
79
+ Post.by_author([Author.find(1), Author.find(2)])
80
+ Post.by_author(Author.active)
81
+ ```
76
82
 
77
83
  For this use case Edge Rider defines `#collect_ids` on many different types:
78
84
 
79
- Post.where(id: [1, 2]).collect_ids # => [1, 2]
80
- [Post.find(1), Post.find(2)].collect_ids # => [1, 2]
81
- Post.find(1).collect_ids # => [1]
82
- [1, 2, 3].collect_ids # => [1, 2, 3]
83
- 1.collect_ids # => [1]
85
+ ```ruby
86
+ Post.where(id: [1, 2]).collect_ids # => [1, 2]
87
+ [Post.find(1), Post.find(2)].collect_ids # => [1, 2]
88
+ Post.find(1).collect_ids # => [1]
89
+ [1, 2, 3].collect_ids # => [1, 2, 3]
90
+ 1.collect_ids # => [1]
91
+ ```
84
92
 
85
93
  You can now write `Post.by_author` from the example above without a single `if` or `case`:
86
94
 
87
- class Post < ActiveRecord::Base
88
-
89
- belongs_to :author
95
+ ```ruby
96
+ class Post < ActiveRecord::Base
97
+
98
+ belongs_to :author
99
+
100
+ def self.for_author(author_or_authors)
101
+ where(author_id: author_or_authors.collect_ids)
102
+ end
103
+
104
+ end
105
+ ```
90
106
 
91
- def self.for_author(author_or_authors)
92
- where(author_id: author_or_authors.collect_ids)
93
- end
94
107
 
95
- end
96
-
97
-
98
108
  ### Efficiently collect all values in a relation's column
99
109
 
100
110
  You often want to ask a relation for an array of all values ofin a given column.
@@ -106,8 +116,10 @@ its column value.
106
116
  Edge Rider has a better way. Your relations gain a method `#collect_column` that will
107
117
  fetch all column values in a single query without instantiating a single ActiveRecord object:
108
118
 
109
- posts = Post.where(archived: false)
110
- subjects = posts.collect_column(:subject)
119
+ ```ruby
120
+ posts = Post.where(archived: false)
121
+ subjects = posts.collect_column(:subject)
122
+ ```
111
123
 
112
124
  *Implementation note:* `#collect_column` delegates to [`#pluck`](https://apidock.com/rails/ActiveRecord/Calculations/pluck),
113
125
  which can be used for the same effect.
@@ -116,8 +128,10 @@ which can be used for the same effect.
116
128
 
117
129
  If you only care about *unique* values, use the `distinct: true` option:
118
130
 
119
- posts = Post.where(archived: false)
120
- distinct_subjects = posts.collect_column(:subject, distinct: true)
131
+ ```ruby
132
+ posts = Post.where(archived: false)
133
+ distinct_subjects = posts.collect_column(:subject, distinct: true)
134
+ ```
121
135
 
122
136
  With this options duplicates are discarded by the database before making their way into Ruby.
123
137
 
@@ -136,38 +150,49 @@ mashes together strings that mostly happen to look like a MySQL query in the end
136
150
 
137
151
  Edge Rider gives your relations a new method `#to_id_query`:
138
152
 
139
- Site.joins(user).where(:users: { name: 'Bruce' }).to_id_query
153
+ ```ruby
154
+ Site.joins(user).where(:users: { name: 'Bruce' }).to_id_query
155
+ ```
140
156
 
141
157
  `#to_id_query` will immediately run an SQL query where it collects all the IDs that match your relation:
142
158
 
143
- SELECT sites.id FROM sites INNER JOIN users WHERE sites.user_id = sites.id AND users.name = 'Bruce'
159
+ ```sql
160
+ SELECT sites.id FROM sites INNER JOIN users WHERE sites.user_id = sites.id AND users.name = 'Bruce'
161
+ ```
144
162
 
145
163
  It now uses these IDs to return a new relation that has **no joins** and a single condition on the `id` column:
146
164
 
147
- SELECT * FROM sites WHERE sites.user_id IN (3, 17, 103)
165
+ ```sql
166
+ SELECT * FROM sites WHERE sites.user_id IN (3, 17, 103)
167
+ ```
148
168
 
149
169
 
150
170
  ### Preload associations for loaded ActiveRecords
151
171
 
152
172
  Sometimes you want to fetch associations for records that you already instantiated, e.g. when it has deeply nested associations.
153
173
 
154
- Edge Rider gives your model classes a method `.preload_associations`. The method can be used to preload associations for loaded objects like this:
174
+ Edge Rider gives your model classes and instances a method `preload_associations`. The method can be used to preload associations for loaded objects like this:
155
175
 
156
- @user = User.find(params[:id])
157
- User.preload_associations [@user], { threads: { posts: :author }, messages: :sender }
176
+ ```ruby
177
+ @user = User.find(params[:id])
178
+ User.preload_associations [@user], { threads: { posts: :author }, messages: :sender }
179
+ # or
180
+ user.preload_associations { threads: { posts: :author }, messages: :sender }
181
+ ```
158
182
 
159
183
  *Implementation note*: Rails 3.0 already has a method [`.preload_associations`](https://apidock.com/rails/ActiveRecord/AssociationPreload/ClassMethods/preload_associations)
160
184
  which Edge Rider merely makes public. Edge Rider ports this method forward to Rails 3.1+.
161
185
 
162
186
 
163
-
164
187
  ### Retrieve the class a relation is based on
165
188
 
166
189
  Edge Rider gives your relations a method `#origin_class` that returns the class the relation is based on.
167
190
  This is useful e.g. to perform unscoped record look-up.
168
191
 
169
- Post.recent.origin_class
170
- # => Post
192
+ ```ruby
193
+ Post.recent.origin_class
194
+ # => Post
195
+ ```
171
196
 
172
197
  Note that `#origin_class` it roughly equivalent to the blockless form of [`unscoped`](https://apidock.com/rails/ActiveRecord/Scoping/Default/ClassMethods/unscoped) from Rails 3.2+,
173
198
  but it works consistently across all Rails versions.
@@ -180,8 +205,10 @@ Edge Rider ports `Model.scoped` forward to Rails 4+ (taken from
180
205
  enables you to consistently turn models into scopes or narrow down scopes
181
206
  across all versions of Rails.
182
207
 
183
- User.scoped # just calls User.all in Rails 4
184
- User.active.scoped(conditions: { admin: true })
208
+ ```ruby
209
+ User.scoped # just calls User.all in Rails 4
210
+ User.active.scoped(conditions: { admin: true })
211
+ ```
185
212
 
186
213
  *Implementation note*: Rails 3 already have a method
187
214
  [`.scoped`](https://apidock.com/rails/ActiveRecord/Scoping/Named/ClassMethods/scoped) which Edge Rider does not touch. Rails 4 has removed this method and
@@ -194,21 +221,21 @@ slightly different in all versions of Rails (see
194
221
  methods are not modified.
195
222
 
196
223
 
197
- Installation
198
- ------------
224
+ ## Installation
199
225
 
200
226
  In your `Gemfile` say:
201
227
 
202
- gem 'edge_rider'
228
+ ```ruby
229
+ gem 'edge_rider'
230
+ ```
203
231
 
204
232
  Now run `bundle install` and restart your server.
205
233
 
206
234
 
207
- Development
208
- -----------
235
+ ## Development
209
236
 
210
237
  - There are tests in `spec`. We only accept PRs with tests.
211
- - 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 Travis CI.
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.
212
239
  - Put your database credentials into `spec/support/database.yml`. There's a `database.sample.yml` you can use as a template.
213
240
  - Create a database `edge_rider_test` in both MySQL and PostgreSQL.
214
241
  - There are gem bundles in the project root for each combination of ActiveRecord version and database type that we support.
@@ -222,7 +249,6 @@ If you would like to contribute:
222
249
  - Send me a pull request.
223
250
 
224
251
 
225
- Credits
226
- -------
252
+ ## Credits
227
253
 
228
254
  Henning Koch from [makandra](http://makandra.com/)
data/edge_rider.gemspec CHANGED
@@ -1,20 +1,30 @@
1
- $:.push File.expand_path("../lib", __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
2
3
  require "edge_rider/version"
3
4
 
4
- Gem::Specification.new do |s|
5
- s.name = 'edge_rider'
6
- s.version = EdgeRider::VERSION
7
- s.authors = ["Henning Koch"]
8
- s.email = 'henning.koch@makandra.de'
9
- s.homepage = 'https://github.com/makandra/edge_rider'
10
- s.summary = 'Power tools for ActiveRecord relations (scopes)'
11
- s.description = s.summary
12
- s.license = 'MIT'
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'edge_rider'
7
+ spec.version = EdgeRider::VERSION
8
+ spec.required_ruby_version = '>= 2.3.0'
9
+ spec.authors = ['Henning Koch']
10
+ spec.email = ['henning.koch@makandra.de']
13
11
 
14
- s.files = `git ls-files`.split("\n").select { |path| File.exist?(path) && !File.symlink?(path) }
15
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select { |path| File.exist?(path) && !File.symlink?(path) }
16
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
- s.require_paths = ["lib"]
12
+ spec.summary = 'Power tools for ActiveRecord relations (scopes)'
13
+ spec.description = spec.summary
14
+ spec.homepage = 'https://github.com/makandra/edge_rider'
15
+ spec.license = 'MIT'
16
+ spec.metadata = { 'rubygems_mfa_required' => 'true' }
18
17
 
19
- s.add_dependency('activerecord')
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
21
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ end
23
+ spec.bindir = 'exe'
24
+ spec.executables = spec.files.grep(%r(^exe/)) { |f| File.basename(f) }
25
+ spec.require_paths = ['lib']
26
+
27
+ spec.add_dependency('activerecord', '>=3.2')
28
+
29
+ # Development dependencies are defined in the Gemfile (therefore no `spec.add_development_dependency` directives)
20
30
  end
@@ -1,25 +1,27 @@
1
1
  module EdgeRider
2
2
  module PreloadAssociations
3
+ module PreloadAssociationsInstanceMethod
4
+ def preload_associations(*args)
5
+ self.class.preload_associations([self], *args)
6
+ end
7
+ end
3
8
 
4
9
  def preload_associations(*args)
5
10
  preloader = ActiveRecord::Associations::Preloader
6
11
 
7
- if preloader.method_defined?(:preload) # Rails 4
8
- preloader.new.preload(*args)
9
- else
12
+ if preloader.method_defined?(:run) # Rails 3.2 / Rails 4
10
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
11
21
  end
12
22
  end
13
23
 
14
- if ActiveRecord::Base.respond_to?(:preload_associations, true) # Rails 2/3.0
15
- ActiveRecord::Base.class_eval do
16
- class << self
17
- public :preload_associations
18
- end
19
- end
20
- else # Rails 3.2+
21
- ActiveRecord::Base.send(:extend, self)
22
- end
23
-
24
+ ActiveRecord::Base.send(:extend, self)
25
+ ActiveRecord::Base.send(:include, PreloadAssociationsInstanceMethod)
24
26
  end
25
27
  end
@@ -8,7 +8,7 @@ module EdgeRider
8
8
 
9
9
  scope = scoped({})
10
10
 
11
- associations.each_with_index do |association, index|
11
+ associations.each do |association|
12
12
 
13
13
  reflection = scope.reflect_on_association(association) or raise UnknownAssociation, "Could not find association: #{self.name}##{association}"
14
14
  foreign_key = reflection.respond_to?(:foreign_key) ? reflection.foreign_key : reflection.primary_key_name
@@ -24,8 +24,12 @@ module EdgeRider
24
24
  if reflection.through_reflection # has_many :through
25
25
  scope = scope.traverse_association(reflection.through_reflection.name, reflection.source_reflection.name)
26
26
  else # has_many or has_one
27
- ids = scope.collect_ids
28
- scope = EdgeRider::Util.exclusive_query(reflection.klass, foreign_key => ids)
27
+ conditions = {}
28
+ # A polymorphic association has a type attribute, e.g. record_type, that needs to be added to condition.
29
+ conditions[reflection.type] = self.name if reflection.type.present?
30
+ conditions[foreign_key] = scope.collect_ids
31
+
32
+ scope = EdgeRider::Util.exclusive_query(reflection.klass, conditions)
29
33
  end
30
34
  else
31
35
  raise UnsupportedAssociation, "Unsupport association type: #{reflection.macro}"
@@ -52,7 +52,7 @@ module EdgeRider
52
52
  # but Rails 2 does not have it.
53
53
  other_options = options.slice!(:conditions)
54
54
  scope = lambda { |*args| scoped(options) }
55
- owner.send association, target, scope, other_options
55
+ owner.send association, target, scope, **other_options
56
56
  end
57
57
  end
58
58
 
@@ -1,3 +1,3 @@
1
1
  module EdgeRider
2
- VERSION = '1.0.0'
2
+ VERSION = '2.1.0'
3
3
  end
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: 1.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-12 00:00:00.000000000 Z
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,26 +16,27 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '3.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: '0'
26
+ version: '3.2'
27
27
  description: Power tools for ActiveRecord relations (scopes)
28
- email: henning.koch@makandra.de
28
+ email:
29
+ - henning.koch@makandra.de
29
30
  executables: []
30
31
  extensions: []
31
32
  extra_rdoc_files: []
32
33
  files:
34
+ - ".github/workflows/test.yml"
33
35
  - ".gitignore"
36
+ - ".rspec"
34
37
  - ".ruby-version"
35
- - ".travis.yml"
36
38
  - CHANGELOG.md
37
- - Gemfile.3.2.mysql2
38
- - Gemfile.3.2.mysql2.lock
39
+ - Gemfile
39
40
  - Gemfile.4.2.mysql2
40
41
  - Gemfile.4.2.mysql2.lock
41
42
  - Gemfile.4.2.pg
@@ -44,8 +45,11 @@ files:
44
45
  - Gemfile.5.2.mysql2.lock
45
46
  - Gemfile.5.2.pg
46
47
  - Gemfile.5.2.pg.lock
47
- - Gemfile.6.0.pg
48
- - Gemfile.6.0.pg.lock
48
+ - Gemfile.6.1.pg
49
+ - Gemfile.6.1.pg.lock
50
+ - Gemfile.7.0.pg
51
+ - Gemfile.7.0.pg.lock
52
+ - Gemfile.lock
49
53
  - LICENSE
50
54
  - README.md
51
55
  - Rakefile
@@ -61,23 +65,11 @@ files:
61
65
  - lib/edge_rider/traverse_association.rb
62
66
  - lib/edge_rider/util.rb
63
67
  - lib/edge_rider/version.rb
64
- - spec/edge_rider/collect_column_spec.rb
65
- - spec/edge_rider/collect_ids_spec.rb
66
- - spec/edge_rider/origin_class_spec.rb
67
- - spec/edge_rider/preload_associations_spec.rb
68
- - spec/edge_rider/scoped_spec.rb
69
- - spec/edge_rider/to_id_query_spec.rb
70
- - spec/edge_rider/traverse_association_spec.rb
71
- - spec/edge_rider/util_spec.rb
72
- - spec/spec_helper.rb
73
- - spec/support/database.rb
74
- - spec/support/database.sample.yml
75
- - spec/support/database.travis.yml
76
- - spec/support/models.rb
77
68
  homepage: https://github.com/makandra/edge_rider
78
69
  licenses:
79
70
  - MIT
80
- metadata: {}
71
+ metadata:
72
+ rubygems_mfa_required: 'true'
81
73
  post_install_message:
82
74
  rdoc_options: []
83
75
  require_paths:
@@ -86,15 +78,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
78
  requirements:
87
79
  - - ">="
88
80
  - !ruby/object:Gem::Version
89
- version: '0'
81
+ version: 2.3.0
90
82
  required_rubygems_version: !ruby/object:Gem::Requirement
91
83
  requirements:
92
84
  - - ">="
93
85
  - !ruby/object:Gem::Version
94
86
  version: '0'
95
87
  requirements: []
96
- rubyforge_project:
97
- rubygems_version: 2.4.5.1
88
+ rubygems_version: 3.2.32
98
89
  signing_key:
99
90
  specification_version: 4
100
91
  summary: Power tools for ActiveRecord relations (scopes)
data/.travis.yml DELETED
@@ -1,63 +0,0 @@
1
- language: ruby
2
-
3
- rvm:
4
- - '2.2.4'
5
- - '2.3.1'
6
- - '2.4.1'
7
- - '2.5.3'
8
-
9
- gemfile:
10
- - 'Gemfile.3.2.mysql2'
11
- - 'Gemfile.4.2.mysql2'
12
- - 'Gemfile.4.2.pg'
13
- - 'Gemfile.5.2.mysql2'
14
- - 'Gemfile.5.2.pg'
15
- - 'Gemfile.6.0.pg'
16
-
17
- matrix:
18
- exclude:
19
- # Rails 3.2
20
- - gemfile: 'Gemfile.3.2.mysql2'
21
- rvm: '2.3.1'
22
- - gemfile: 'Gemfile.3.2.mysql2'
23
- rvm: '2.4.1'
24
- - gemfile: 'Gemfile.3.2.mysql2'
25
- rvm: '2.5.3'
26
- # Rails 4.2
27
- - gemfile: 'Gemfile.4.2.mysql2'
28
- rvm: '2.4.1'
29
- - gemfile: 'Gemfile.4.2.pg'
30
- rvm: '2.4.1'
31
- - gemfile: 'Gemfile.4.2.mysql2'
32
- rvm: '2.5.3'
33
- - gemfile: 'Gemfile.4.2.pg'
34
- rvm: '2.5.3'
35
- # Rails 5.2
36
- # Rails 6
37
- - gemfile: 'Gemfile.6.0.pg'
38
- rvm: '2.2.4'
39
- - gemfile: 'Gemfile.6.0.pg'
40
- rvm: '2.3.1'
41
- - gemfile: 'Gemfile.6.0.pg'
42
- rvm: '2.4.1'
43
-
44
- services:
45
- - mysql
46
-
47
- install:
48
- # Replace default Travis CI bundler script with a version that doesn't
49
- # explode when lockfile doesn't match recently bumped version
50
- - bundle install --no-deployment --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}
51
-
52
- addons:
53
- postgresql: 9.3
54
-
55
- before_script:
56
- - psql -c 'create database edge_rider_test;' -U postgres
57
- - mysql -e 'create database IF NOT EXISTS edge_rider_test;'
58
-
59
- script: bundle exec rake current_rspec
60
-
61
- notifications:
62
- email:
63
- - fail@makandra.de