arel-extensions 8.0.2 → 8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f10fd80539653570d9ea7333fa9f9aef21e29ccdb9f9a976fa178e106c1f3c66
4
- data.tar.gz: 02efc9b543b5325e61899a590982207378482592f13a91ccb121d94a621a1966
3
+ metadata.gz: 26af903829c4fe9d8b881fcd316d09a03f9253af796ab813523d6c074e7fc3fe
4
+ data.tar.gz: 4c8ff81dc39a82b8dabd1fe792b18c43e9d683bc5f8ede192932fda4d0864667
5
5
  SHA512:
6
- metadata.gz: 4da172777f5c26a8eafcc82faef85510967381601e67c6d8259229be3097aaa483ad8f57bddb3d42733b95a805ace1f40f84aa2a89777a4fe33f9b2647669e85
7
- data.tar.gz: 40873247a7c72bd997f424df0ebf1e421f158046967929ef4d11ae932e1d10422b26fe78feb56a86086b2eb261d20e118dbbe848f10a862d04fae8701bb4340f
6
+ metadata.gz: 9a596cde6baa6b9b54fe900786dd63980da37bbe10408ca09ed9bf7a1df3ddb23de11d79e64f75634120e93e134dd739f36872131e13cba2fc1bb90eaa064deb
7
+ data.tar.gz: 53b6e4cd418d977fb825e1f9753b117bf5b64644dc29be64c530f9f15f44f158aa16f4dc0acd0a39a78eea7856ebf0ec27aa3b65cb7f5b83e09c9e93398e899d
@@ -5,16 +5,21 @@ on: [push, pull_request]
5
5
  jobs:
6
6
  sunstone:
7
7
  name: Arel::Extensions Test
8
- runs-on: ubuntu-22.04
8
+ runs-on: ubuntu-24.04
9
9
  strategy:
10
10
  fail-fast: false
11
11
  matrix:
12
- rails: ['7.1.5.1', '7.2.2.1', '8.0.1']
13
- ruby-version: ['3.1', '3.2', '3.3', '3.4']
14
- postgres-version: ['17']
15
- exclude:
16
- - rails: '8.0.1'
17
- ruby-version: '3.1'
12
+ rails-version:
13
+ - 7.1.6
14
+ - 7.2.3
15
+ - 8.0.4
16
+ - 8.1.1
17
+ ruby-version:
18
+ - 3.3
19
+ - 3.4
20
+ - 4.0.0-preview2
21
+ postgres-version:
22
+ - 17
18
23
 
19
24
  steps:
20
25
  - name: Install Postgresql
@@ -39,15 +44,10 @@ jobs:
39
44
  ruby-version: ${{ matrix.ruby-version }}
40
45
  bundler-cache: false # runs 'bundle install' and caches installed gems automatically
41
46
 
42
- - name: Fix activerecord-postgis-adapter
43
- if: ${{ matrix.rails == '8.0.1' }}
44
- run: |
45
- echo "gem 'activerecord-postgis-adapter', github: 'rgeo/activerecord-postgis-adapter', branch: 'rails8'" >> Gemfile
46
-
47
47
  - run: |
48
- sed -i -e "s/gem.add_dependency 'activerecord', '>= [[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+'/gem.add_dependency 'activerecord', '${{ matrix.rails }}'/" arel-extensions.gemspec
48
+ sed -i -e "s/gem.add_dependency 'activerecord', '>= [[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+'/gem.add_dependency 'activerecord', '${{ matrix.rails-version }}'/" arel-extensions.gemspec
49
49
  rm -f Gemfile.lock
50
- bundle
50
+ bundle install --jobs=3 --retry=3
51
51
 
52
52
  - name: Test Geos
53
53
  run: |
@@ -57,14 +57,23 @@ jobs:
57
57
 
58
58
  ar-postgresql:
59
59
  name: ActiveRecord PostgresQL Test
60
- runs-on: ubuntu-22.04
60
+ runs-on: ubuntu-24.04
61
61
 
62
62
  strategy:
63
63
  fail-fast: false
64
64
  matrix:
65
- rails: ['7.1.5.1', '7.2.2.1', '8.0.1']
66
- ruby-version: ['3.3']
67
- postgres-version: ['17']
65
+ rails-version:
66
+ - 7.2.3
67
+ - 8.0.4
68
+ - 8.1.1
69
+ ruby-version:
70
+ - 3.4
71
+ postgres-version:
72
+ - 17
73
+ include:
74
+ - rails-version: '7.1.6'
75
+ ruby-version: '3.3'
76
+ postgres-version: '17'
68
77
 
69
78
  steps:
70
79
  - name: Install Postgresql
@@ -90,7 +99,7 @@ jobs:
90
99
 
91
100
  - name: Download Rails
92
101
  run: |
93
- git clone --branch v${{ matrix.rails }} https://github.com/rails/rails.git ~/rails
102
+ git clone --branch v${{ matrix.rails-version }} https://github.com/rails/rails.git ~/rails
94
103
  pushd ~/rails
95
104
  cat /home/runner/work/_temp/*.sh
96
105
  sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/rails/activerecord/Rakefile
@@ -101,12 +110,23 @@ jobs:
101
110
  echo "gem 'ostruct'" >> ~/rails/Gemfile
102
111
  sed -i "s/# frozen_string_literal: true/# frozen_string_literal: true\nrequire 'ostruct'/" ~/rails/activerecord/test/cases/encryption/configurable_test.rb
103
112
  cat ~/rails/Gemfile
104
- bundle update --jobs=3 --retry=3
113
+
114
+ - name: This can eventually be removed
115
+ run: |
116
+ sed -i 's/gem "minitest"$/gem "minitest"\ngem "minitest-mock", require: "minitest\/mock"/' ~/rails/Gemfile
117
+ sed -i 's/module ActiveRecord$/module Rails\nend\nmodule ActiveRecord/' ~/rails/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb || true
118
+ sed -i 's/t.options = "--profile" if ENV\["CI"\]//g' ~/rails/activerecord/Rakefile
105
119
 
106
120
  - name: Fix Weird Test Cases
107
121
  run: |
108
122
  sed -i 's|} - \[:|} - \[:distinct_on, :uniq_on, :|' ~/rails/activerecord/test/cases/relation/delegation_test.rb
109
123
 
124
+ - name: Bundle
125
+ run: |
126
+ pushd ~/rails
127
+ bundle update --jobs=3 --retry=3
128
+ popd
129
+
110
130
  - run: |
111
131
  pushd ~/rails/activerecord
112
132
  bundle exec rake db:postgresql:rebuild postgresql:test --trace
@@ -114,14 +134,20 @@ jobs:
114
134
 
115
135
  ar-sqlite:
116
136
  name: ActiveRecord SQLite Test
117
- runs-on: ubuntu-22.04
137
+ runs-on: ubuntu-24.04
118
138
 
119
139
  strategy:
120
140
  fail-fast: false
121
141
  matrix:
122
- rails: ['7.1.5.1', '7.2.2.1', '8.0.1']
123
- ruby-version: ['3.3']
124
- postgres-version: ['17']
142
+ rails-version:
143
+ - 7.2.3
144
+ - 8.0.4
145
+ - 8.1.1
146
+ ruby-version:
147
+ - 3.4
148
+ include:
149
+ - rails-version: '7.1.6'
150
+ ruby-version: '3.3'
125
151
 
126
152
  steps:
127
153
  - uses: actions/checkout@v4
@@ -133,7 +159,7 @@ jobs:
133
159
 
134
160
  - name: Download Rails
135
161
  run: |
136
- git clone --branch v${{ matrix.rails }} https://github.com/rails/rails.git ~/rails
162
+ git clone --branch v${{ matrix.rails-version }} https://github.com/rails/rails.git ~/rails
137
163
  pushd ~/rails
138
164
  cat /home/runner/work/_temp/*.sh
139
165
  sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/rails/activerecord/Rakefile
@@ -144,15 +170,25 @@ jobs:
144
170
  echo "gem 'ostruct'" >> ~/rails/Gemfile
145
171
  sed -i "s/# frozen_string_literal: true/# frozen_string_literal: true\nrequire 'ostruct'/" ~/rails/activerecord/test/cases/encryption/configurable_test.rb
146
172
  cat ~/rails/Gemfile
147
- bundle update --jobs=3 --retry=3
173
+
174
+ - name: This can eventually be removed
175
+ run: |
176
+ sed -i 's/gem "minitest"$/gem "minitest"\ngem "minitest-mock", require: "minitest\/mock"/' ~/rails/Gemfile
177
+ cat ~/rails/Gemfile
178
+ sed -i 's/module ActiveRecord$/module Rails\nend\nmodule ActiveRecord/' ~/rails/activerecord/test/cases/adapters/sqlite3/dbconsole_test.rb
179
+ cat ~/rails/activerecord/test/cases/adapters/sqlite3/dbconsole_test.rb
180
+ sed -i 's/t.options = "--profile" if ENV\["CI"\]//g' ~/rails/activerecord/Rakefile
181
+ cat ~/rails/activerecord/Rakefile
148
182
 
149
183
  - name: Fix Weird Test Cases
150
184
  run: |
151
185
  sed -i 's|} - \[:|} - \[:distinct_on, :uniq_on, :|' ~/rails/activerecord/test/cases/relation/delegation_test.rb
152
186
 
153
- - name: Fix Weird Test Cases
187
+ - name: Bundle
154
188
  run: |
155
- cat ~/rails/activerecord/test/cases/relation/delegation_test.rb
189
+ pushd ~/rails
190
+ bundle update --jobs=3 --retry=3
191
+ popd
156
192
 
157
193
  - run: |
158
194
  pushd ~/rails/activerecord
@@ -164,14 +200,20 @@ jobs:
164
200
 
165
201
  ar-mysql:
166
202
  name: ActiveRecord MySQL Test
167
- runs-on: ubuntu-22.04
203
+ runs-on: ubuntu-24.04
168
204
 
169
205
  strategy:
170
206
  fail-fast: false
171
207
  matrix:
172
- rails: ['7.1.5.1', '7.2.2.1', '8.0.1']
173
- ruby-version: ['3.3']
174
- postgres-version: ['17']
208
+ rails-version:
209
+ - 7.2.3
210
+ - 8.0.4
211
+ - 8.1.1
212
+ ruby-version:
213
+ - 3.4
214
+ include:
215
+ - rails-version: '7.1.6'
216
+ ruby-version: '3.3'
175
217
 
176
218
  steps:
177
219
  - name: Install MySQL
@@ -189,7 +231,7 @@ jobs:
189
231
 
190
232
  - name: Download Rails
191
233
  run: |
192
- git clone --branch v${{ matrix.rails }} https://github.com/rails/rails.git ~/rails
234
+ git clone --branch v${{ matrix.rails-version }} https://github.com/rails/rails.git ~/rails
193
235
  pushd ~/rails
194
236
  cat /home/runner/work/_temp/*.sh
195
237
  sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/rails/activerecord/Rakefile
@@ -200,12 +242,25 @@ jobs:
200
242
  echo "gem 'ostruct'" >> ~/rails/Gemfile
201
243
  sed -i "s/# frozen_string_literal: true/# frozen_string_literal: true\nrequire 'ostruct'/" ~/rails/activerecord/test/cases/encryption/configurable_test.rb
202
244
  cat ~/rails/Gemfile
203
- bundle update --jobs=3 --retry=3
245
+
246
+ - name: This can eventually be removed
247
+ run: |
248
+ sed -i 's/gem "minitest"$/gem "minitest"\ngem "minitest-mock", require: "minitest\/mock"/' ~/rails/Gemfile
249
+ sed -i 's/class WarningsTest < ActiveRecord::AbstractMysqlTestCase$/module Rails\nend\nclass WarningsTest < ActiveRecord::AbstractMysqlTestCase/' ~/rails/activerecord/test/cases/adapters/abstract_mysql_adapter/warnings_test.rb || true
250
+ sed -i 's/class Mysql2AdapterTest < ActiveRecord::Mysql2TestCase$/module Rails\nend\nclass Mysql2AdapterTest < ActiveRecord::Mysql2TestCase/' ~/rails/activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb || true
251
+ sed -i 's/t.options = "--profile" if ENV\["CI"\]//g' ~/rails/activerecord/Rakefile
252
+ cat ~/rails/activerecord/Rakefile
204
253
 
205
254
  - name: Fix Weird Test Cases
206
255
  run: |
207
256
  sed -i 's|} - \[:|} - \[:distinct_on, :uniq_on, :|' ~/rails/activerecord/test/cases/relation/delegation_test.rb
208
257
 
258
+ - name: Bundle
259
+ run: |
260
+ pushd ~/rails
261
+ bundle update --jobs=3 --retry=3
262
+ popd
263
+
209
264
  - run: |
210
265
  pushd ~/rails/activerecord
211
266
  bundle exec rake db:mysql:rebuild mysql2:test --trace
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class Ascending < Ordering
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class Descending < Ordering
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Ordering with :nulls_last, :nulls_first options
2
4
  module Arel
3
5
  module OrderPredications
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_record'
2
4
  require 'active_record/relation'
3
5
  require 'active_record/querying'
@@ -25,8 +27,14 @@ module ActiveRecord::QueryMethods
25
27
  alias uniq_on! distinct_on!
26
28
 
27
29
  private
28
-
29
- if ActiveRecord.version >= "7.2"
30
+
31
+ if ActiveRecord.version >= "8.1"
32
+ def build_arel_with_distinct_on(aliases = nil)
33
+ arel = build_arel_without_distinct_on(aliases)
34
+ arel.distinct_on(self.distinct_on_values) if !self.distinct_on_values.empty?
35
+ arel
36
+ end
37
+ elsif ActiveRecord.version >= "7.2"
30
38
  def build_arel_with_distinct_on(connection, aliases = nil)
31
39
  arel = build_arel_without_distinct_on(connection, aliases)
32
40
  arel.distinct_on(self.distinct_on_values) if !self.distinct_on_values.empty?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module ArrayPredications
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Attributes
3
5
  class Cast < Attribute
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Attributes
3
5
  class Key < Attribute
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Extensions
3
- VERSION = '8.0.2'
5
+ VERSION = '8.1.0'
4
6
  end
5
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "arel"
2
4
  require File.expand_path('../nodes/binary_value', __FILE__)
3
5
  require File.expand_path('../nodes/hex_encoded_binary_value', __FILE__)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module GISPredications
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module JSONPredications
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class BinaryValue < Arel::Nodes::Unary
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class ContainedBy < InfixOperation
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class Excludes < Binary
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class Geometry < Arel::Nodes::Unary
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class HasAnyKey < Binary
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class HasKey < Binary
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class HasKeys < Binary
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class HexEncodedBinaryValue < Arel::Nodes::Unary
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class Intersects < Binary
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class RandomOrdering < Arel::Nodes::Node
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Attributes
3
5
  class Relation < Attribute
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class TSMatch < Binary
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class TSQuery < Arel::Nodes::Node
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class TSRank < Arel::Nodes::Node
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class TSRankCD < Arel::Nodes::Node
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class TSVector < Arel::Nodes::Node
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Nodes
3
5
  class Within < Binary
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module TSPredications
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Visitors
3
5
  class PostgreSQL
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Visitors
3
5
  class Sunstone
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Arel
2
4
  module Visitors
3
5
  class ToSql
data/test/test_helper.rb CHANGED
@@ -11,7 +11,6 @@ $LOAD_PATH << File.expand_path('../lib', __FILE__)
11
11
  require 'rgeo'
12
12
  require 'debug'
13
13
  require "minitest/autorun"
14
- require 'minitest/unit'
15
14
  require 'minitest/reporters'
16
15
  require 'webmock/minitest'
17
16
  # require 'mocha/minitest'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arel-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.2
4
+ version: 8.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-01-27 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -170,7 +169,6 @@ dependencies:
170
169
  - - ">="
171
170
  - !ruby/object:Gem::Version
172
171
  version: '8.0'
173
- description:
174
172
  email:
175
173
  - jonbracy@gmail.com
176
174
  executables: []
@@ -227,7 +225,6 @@ homepage: https://github.com/malomalo/arel-extensions
227
225
  licenses:
228
226
  - MIT
229
227
  metadata: {}
230
- post_install_message:
231
228
  rdoc_options: []
232
229
  require_paths:
233
230
  - lib
@@ -242,8 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
239
  - !ruby/object:Gem::Version
243
240
  version: '0'
244
241
  requirements: []
245
- rubygems_version: 3.5.21
246
- signing_key:
242
+ rubygems_version: 4.0.2
247
243
  specification_version: 4
248
244
  summary: Adds support for missing SQL operators and functions to Arel
249
245
  test_files: