active_model-relation 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2440274ca803bb2b2d571a3c7753730c66a86a5c8e5ccba873dbd19541e236a3
4
+ data.tar.gz: cab3d4c534dc3ada120d5660a029cffdd343d5869653f183434cf8fd3793da4b
5
+ SHA512:
6
+ metadata.gz: 12fe2562f8977cb3b2ac5db4f32dce3dd886d9c4d09996e2bf8fbb98e699ac54f6cad071625cc430c4de1615a3089fdf178bdc2d9c738d1f96b2fbe58a185ff7
7
+ data.tar.gz: 7cf7a6a159a8b5df87c5112644f2dc1118cf5e91b26bdf273c182e8ea4d84768291618ec4c0b47bd3b985217d26331551d9bec5a8f8e5a8c6bc59f69b00f3f7e
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.1
3
+ NewCops: enable
4
+ SuggestExtensions: false
5
+
6
+ Layout/LineLength:
7
+ Max: 120
8
+
9
+ Metrics/BlockLength:
10
+ Exclude:
11
+ - 'spec/**/*'
12
+
13
+ Style/Documentation:
14
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2024-08-30
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at benedikt@benediktdeicke.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Benedikt Deicke
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.
data/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # ActiveModel::Relation
2
+
3
+ This library allows querying of collections of Ruby objects, with a similar interfaces to `ActiveRecord::Relation`.
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ $ bundle add active_model-relation
10
+
11
+ If bundler is not being used to manage dependencies, install the gem by executing:
12
+
13
+ $ gem install active_model-relation
14
+
15
+ ## Usage
16
+
17
+ Create a new relation by passing the model class and a collection:
18
+
19
+ ```ruby
20
+ relation = ActiveModel::Relation.new(Project, [
21
+ Project.new(id: 1, state: 'draft', priority: 1),
22
+ Project.new(id: 2, state: 'running', priority: 2),
23
+ Project.new(id: 3, state: 'completed', priority: 3),
24
+ Project.new(id: 4, state: 'completed', priority: 1)
25
+ ])
26
+ ```
27
+
28
+ Afterwards you can use it (almost) like an `ActiveRecord::Relation`.
29
+
30
+ ```ruby
31
+ relation.where(state: 'completed')
32
+ relation.offset(3)
33
+ relation.limit(2)
34
+ relation.order(priority: :asc, state: :desc)
35
+ ```
36
+
37
+ You can also write named filter methods on the model class, after including `ActiveModel::Relation::Model`.
38
+
39
+ ```ruby
40
+ class Project
41
+ include ActiveModel::Model
42
+ include ActiveModel::Attributes
43
+ include ActiveModel::Relation::Model
44
+
45
+ attribute :id, :integer
46
+ attribute :state, :string, default: :draft
47
+ attribute :priority, :integer, default: 1
48
+
49
+ def self.completed
50
+ where(state: 'completed')
51
+ end
52
+ end
53
+ ```
54
+
55
+ ## Development
56
+
57
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
58
+
59
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
60
+
61
+ ## Contributing
62
+
63
+ Bug reports and pull requests are welcome on GitHub at https://github.com/userlist/active_model-relation. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/userlist/active_model-relation/blob/main/CODE_OF_CONDUCT.md).
64
+
65
+ ## License
66
+
67
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
68
+
69
+ ## Code of Conduct
70
+
71
+ Everyone interacting in the ActiveModel::Relation project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/userlist/active_model-relation/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveModel
4
+ class Relation
5
+ module Model
6
+ extend ActiveSupport::Concern
7
+
8
+ include ActiveModel::Relation::Scoping
9
+ include ActiveModel::Relation::Querying
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveModel
4
+ class Relation
5
+ class OrderClause
6
+ class OrderExpression
7
+ attr_reader :name
8
+
9
+ def initialize(name)
10
+ @name = name
11
+ end
12
+
13
+ def call(_, _)
14
+ 0
15
+ end
16
+ end
17
+
18
+ class Ascending < OrderExpression
19
+ def call(record, other)
20
+ record.public_send(name) <=> other.public_send(name)
21
+ end
22
+ end
23
+
24
+ class Descending < OrderExpression
25
+ def call(record, other)
26
+ other.public_send(name) <=> record.public_send(name)
27
+ end
28
+ end
29
+
30
+ attr_reader :expressions
31
+
32
+ def self.build(value = [])
33
+ if value.is_a?(Array)
34
+ from_array(value)
35
+ elsif value.is_a?(Hash)
36
+ from_hash(value)
37
+ else
38
+ from_value(value)
39
+ end
40
+ end
41
+
42
+ def self.from_value(value)
43
+ new(Ascending.new(value))
44
+ end
45
+
46
+ def self.from_array(attributes)
47
+ expressions = attributes.map { |name| build(name) }
48
+
49
+ new(expressions)
50
+ end
51
+
52
+ def self.from_hash(attributes)
53
+ expressions = attributes.map do |name, direction|
54
+ if direction == :asc
55
+ Ascending.new(name)
56
+ elsif direction == :desc
57
+ Descending.new(name)
58
+ else
59
+ raise ArgumentError, "Invalid direction #{direction.inspect}. Direction should either be :asc or :desc."
60
+ end
61
+ end
62
+
63
+ new(expressions)
64
+ end
65
+
66
+ def initialize(*expressions)
67
+ @expressions = expressions.flatten(1)
68
+ end
69
+
70
+ def +(other)
71
+ OrderClause.new(@expressions + other.expressions)
72
+ end
73
+
74
+ def call(record, other)
75
+ return 0 if expressions.empty?
76
+
77
+ expressions.each do |expression|
78
+ result = expression.call(record, other)
79
+
80
+ return result unless result.zero?
81
+ end
82
+
83
+ 0
84
+ end
85
+
86
+ def to_proc
87
+ method(:call).to_proc
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveModel
4
+ class Relation
5
+ module Querying
6
+ extend ActiveSupport::Concern
7
+
8
+ module ClassMethods
9
+ delegate :where, :find, :find_by, :offset, :limit, :first, :last, to: :all
10
+
11
+ def all
12
+ current_scope || ActiveModel::Relation.new(self, records)
13
+ end
14
+
15
+ def records
16
+ raise NotImplementedError
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveModel
4
+ class Relation
5
+ module Scoping
6
+ extend ActiveSupport::Concern
7
+
8
+ module ClassMethods
9
+ def current_scope
10
+ ScopeRegistry.current_scope(self)
11
+ end
12
+
13
+ def current_scope=(value)
14
+ ScopeRegistry.set_current_scope(self, value)
15
+ end
16
+ end
17
+
18
+ class ScopeRegistry
19
+ class << self
20
+ delegate :current_scope, :set_current_scope, to: :instance
21
+
22
+ def instance
23
+ ActiveSupport::IsolatedExecutionState[:active_model_scope_registry] ||= new
24
+ end
25
+ end
26
+
27
+ def initialize
28
+ @current_scope = {}
29
+ end
30
+
31
+ def current_scope(model)
32
+ @current_scope[model.name]
33
+ end
34
+
35
+ def set_current_scope(model, value)
36
+ @current_scope[model.name] = value
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveModel
4
+ class Relation
5
+ VERSION = '0.1.0'
6
+ end
7
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveModel
4
+ class Relation
5
+ class WhereChain
6
+ attr_reader :relation
7
+
8
+ def initialize(relation)
9
+ @relation = relation
10
+ end
11
+
12
+ def not(...)
13
+ relation.where_clause += WhereClause.build(...).invert
14
+ relation
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,101 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveModel
4
+ class Relation
5
+ class WhereClause
6
+ class Predicate
7
+ def call(record)
8
+ raise NotImplementedError
9
+ end
10
+
11
+ def invert
12
+ NotPredicate.new(self)
13
+ end
14
+ end
15
+
16
+ class EqualsPredicate < Predicate
17
+ attr_reader :attribute, :value
18
+
19
+ def initialize(attribute, value)
20
+ super()
21
+
22
+ @attribute = attribute
23
+ @value = value
24
+ end
25
+
26
+ def call(record)
27
+ record.public_send(attribute) == value
28
+ end
29
+ end
30
+
31
+ class BlockPredicate < Predicate
32
+ attr_reader :block
33
+
34
+ def initialize(block)
35
+ super()
36
+
37
+ @block = block
38
+ end
39
+
40
+ def call(record)
41
+ block.call(record)
42
+ end
43
+ end
44
+
45
+ class NotPredicate < Predicate
46
+ attr_reader :predicate
47
+
48
+ def initialize(predicate)
49
+ super()
50
+
51
+ @predicate = predicate
52
+ end
53
+
54
+ def call(record)
55
+ !predicate.call(record)
56
+ end
57
+
58
+ def invert
59
+ predicate
60
+ end
61
+ end
62
+
63
+ attr_reader :predicates
64
+
65
+ def self.from_hash(attributes = {})
66
+ new(attributes.map { |attribute, value| EqualsPredicate.new(attribute, value) })
67
+ end
68
+
69
+ def self.from_block(block)
70
+ new(BlockPredicate.new(block))
71
+ end
72
+
73
+ def self.build(attributes = {}, &block)
74
+ where_clause = new
75
+ where_clause += from_hash(attributes) if attributes.any?
76
+ where_clause += from_block(block) if block_given?
77
+ where_clause
78
+ end
79
+
80
+ def initialize(*predicates)
81
+ @predicates = predicates.flatten(1)
82
+ end
83
+
84
+ def +(other)
85
+ WhereClause.new(predicates + other.predicates)
86
+ end
87
+
88
+ def call(record)
89
+ predicates.all? { |predicate| predicate.call(record) }
90
+ end
91
+
92
+ def invert
93
+ WhereClause.new(predicates.map(&:invert))
94
+ end
95
+
96
+ def to_proc
97
+ method(:call).to_proc
98
+ end
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,182 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_model'
4
+
5
+ module ActiveModel
6
+ class ModelNotFound < StandardError
7
+ def initialize(message = nil, model = nil, primary_key = nil, id = nil) # rubocop:disable Metrics/ParameterLists
8
+ @primary_key = primary_key
9
+ @model = model
10
+ @id = id
11
+
12
+ super(message)
13
+ end
14
+ end
15
+
16
+ # = Active Model Relation
17
+ class Relation # rubocop:disable Metrics/ClassLength
18
+ include Enumerable
19
+
20
+ autoload :Model, 'active_model/relation/model'
21
+ autoload :Querying, 'active_model/relation/querying'
22
+ autoload :Scoping, 'active_model/relation/scoping'
23
+ autoload :WhereClause, 'active_model/relation/where_clause'
24
+ autoload :WhereChain, 'active_model/relation/where_chain'
25
+ autoload :OrderClause, 'active_model/relation/order_clause'
26
+
27
+ attr_reader :model
28
+ attr_accessor :offset_value, :limit_value, :where_clause, :order_clause, :extending_values
29
+
30
+ delegate :each, :size, :last, to: :records
31
+
32
+ def initialize(model, records = [])
33
+ @model = model
34
+ @records = records
35
+ @where_clause = WhereClause.new
36
+ @order_clause = OrderClause.new
37
+ @offset_value = nil
38
+ @limit_value = nil
39
+ @extending_values = []
40
+ end
41
+
42
+ def find(id)
43
+ primary_key = model.try(:primary_key) || :id
44
+
45
+ find_by(primary_key => id) ||
46
+ raise(ModelNotFound.new("Couldn't find #{model} with '#{primary_key}'=#{id}", model, primary_key, id))
47
+ end
48
+
49
+ def find_by(attributes = {})
50
+ where_clause = self.where_clause + WhereClause.from_hash(attributes)
51
+
52
+ records.find(&where_clause)
53
+ end
54
+
55
+ def where(...)
56
+ spawn.where!(...)
57
+ end
58
+
59
+ def where!(attributes = {}, &)
60
+ return WhereChain.new(spawn) unless attributes.any? || block_given?
61
+
62
+ self.where_clause += WhereClause.build(attributes, &)
63
+ self
64
+ end
65
+
66
+ def offset(...)
67
+ spawn.offset!(...)
68
+ end
69
+
70
+ def offset!(offset)
71
+ self.offset_value = offset
72
+ self
73
+ end
74
+
75
+ def limit(...)
76
+ spawn.limit!(...)
77
+ end
78
+
79
+ def limit!(limit)
80
+ self.limit_value = limit
81
+ self
82
+ end
83
+
84
+ def order(...)
85
+ spawn.order!(...)
86
+ end
87
+
88
+ def order!(*values)
89
+ self.order_clause += OrderClause.build(values)
90
+ self
91
+ end
92
+
93
+ def extending(...)
94
+ spawn.extending!(...)
95
+ end
96
+
97
+ def extending!(*modules, &)
98
+ modules << Module.new(&) if block_given?
99
+ modules.flatten!
100
+
101
+ self.extending_values += modules
102
+
103
+ extend(*extending_values) if extending_values.any?
104
+
105
+ self
106
+ end
107
+
108
+ def all
109
+ spawn
110
+ end
111
+
112
+ def to_ary
113
+ records.dup
114
+ end
115
+ alias to_a to_ary
116
+
117
+ def records
118
+ @records
119
+ .select(&where_clause)
120
+ .sort(&order_clause)
121
+ .drop(offset_value || 0)
122
+ .take(limit_value || @records.size)
123
+ end
124
+
125
+ def scoping
126
+ previous_scope = model.current_scope
127
+ model.current_scope = self
128
+ yield
129
+ ensure
130
+ model.current_scope = previous_scope
131
+ end
132
+
133
+ def inspect
134
+ entries = records.take(11).map!(&:inspect)
135
+ entries[10] = '...' if entries.size == 11
136
+
137
+ "#<#{self.class.name} [#{entries.join(', ')}]>"
138
+ end
139
+
140
+ def except(*skips)
141
+ relation_with(values.except(*skips))
142
+ end
143
+
144
+ def only(*keeps)
145
+ relation_with(values.slice(*keeps))
146
+ end
147
+
148
+ private
149
+
150
+ def method_missing(...)
151
+ if model.respond_to?(...)
152
+ scoping { model.public_send(...) }
153
+ else
154
+ super
155
+ end
156
+ end
157
+
158
+ def respond_to_missing?(...)
159
+ super || model.respond_to?(...)
160
+ end
161
+
162
+ def spawn
163
+ clone
164
+ end
165
+
166
+ def values
167
+ {
168
+ where: where_clause,
169
+ offset: offset_value,
170
+ limit: limit_value
171
+ }
172
+ end
173
+
174
+ def relation_with(values)
175
+ spawn.tap do |relation|
176
+ relation.where_clause = values[:where] || WhereClause.new
177
+ relation.offset_value = values[:offset]
178
+ relation.limit_value = values[:limit]
179
+ end
180
+ end
181
+ end
182
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: active_model-relation
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Benedikt Deicke
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-09-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activemodel
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '7.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '7.2'
27
+ description: This library allows querying of collections of Ruby objects, with a similar
28
+ interface to ActiveRecord::Relation.
29
+ email:
30
+ - benedikt@benediktdeicke.com
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - ".rspec"
36
+ - ".rubocop.yml"
37
+ - CHANGELOG.md
38
+ - CODE_OF_CONDUCT.md
39
+ - LICENSE.txt
40
+ - README.md
41
+ - Rakefile
42
+ - lib/active_model/relation.rb
43
+ - lib/active_model/relation/model.rb
44
+ - lib/active_model/relation/order_clause.rb
45
+ - lib/active_model/relation/querying.rb
46
+ - lib/active_model/relation/scoping.rb
47
+ - lib/active_model/relation/version.rb
48
+ - lib/active_model/relation/where_chain.rb
49
+ - lib/active_model/relation/where_clause.rb
50
+ homepage: https://github.com/benedikt/active_model-relation/
51
+ licenses:
52
+ - MIT
53
+ metadata:
54
+ homepage_uri: https://github.com/benedikt/active_model-relation/
55
+ source_code_uri: https://github.com/benedikt/active_model-relation/
56
+ changelog_uri: https://github.com/benedikt/active_model-relation/blob/main/CHANGELOG.md
57
+ rubygems_mfa_required: 'true'
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 3.1.0
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubygems_version: 3.5.3
74
+ signing_key:
75
+ specification_version: 4
76
+ summary: Query collection of ActiveModel objects like an ActiveRecord::Relation
77
+ test_files: []