arel-extensions 8.0.1 → 8.0.2

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: 864929650ef61e3f9365767b052b403ec511d8102654e2890e9fd6b97492352a
4
- data.tar.gz: e35c7b6b0a262623b3368f1517363d84c71fd7b91cc0327cc730b41d3f50dbe8
3
+ metadata.gz: f10fd80539653570d9ea7333fa9f9aef21e29ccdb9f9a976fa178e106c1f3c66
4
+ data.tar.gz: 02efc9b543b5325e61899a590982207378482592f13a91ccb121d94a621a1966
5
5
  SHA512:
6
- metadata.gz: 7db5423c6f8ee72c58d6a351a6ac4c8e633c2358762aa797698cc6c3f7710acf520a08c8a1fff5645ab8dfe0f5cadb13edbb115e76cb9c7d394fde8ed0d987fa
7
- data.tar.gz: 30230816dbd511c6631e63908a242792d88f793fc45e5678465f2f9b6f0ba670d563563e0402590e5805fcf5a5cd04d8ed0057a4f91d75df934cbc3a79a91398
6
+ metadata.gz: 4da172777f5c26a8eafcc82faef85510967381601e67c6d8259229be3097aaa483ad8f57bddb3d42733b95a805ace1f40f84aa2a89777a4fe33f9b2647669e85
7
+ data.tar.gz: 40873247a7c72bd997f424df0ebf1e421f158046967929ef4d11ae932e1d10422b26fe78feb56a86086b2eb261d20e118dbbe848f10a862d04fae8701bb4340f
@@ -60,6 +60,7 @@ jobs:
60
60
  runs-on: ubuntu-22.04
61
61
 
62
62
  strategy:
63
+ fail-fast: false
63
64
  matrix:
64
65
  rails: ['7.1.5.1', '7.2.2.1', '8.0.1']
65
66
  ruby-version: ['3.3']
@@ -94,7 +95,7 @@ jobs:
94
95
  cat /home/runner/work/_temp/*.sh
95
96
  sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/rails/activerecord/Rakefile
96
97
  sed -i "s/t.warning = true/t.warning = false/g" ~/rails/activerecord/Rakefile
97
- sed -i "/require 'support\/connection'/a \$LOAD_PATH.unshift\(File.expand_path\(ENV['GITHUB_WORKSPACE']\)\)\nrequire 'arel/extensions'" ~/rails/activerecord/test/cases/helper.rb
98
+ sed -i "/require \"active_record\"/a \$LOAD_PATH.unshift\(File.expand_path\(ENV['GITHUB_WORKSPACE']\)\)\nrequire 'arel/extensions'" ~/rails/activerecord/test/cases/helper.rb
98
99
  rm ~/rails/Gemfile.lock
99
100
  sed -i "/# Active Record./a gem 'arel-extensions', require: 'arel/extensions', path: File.expand_path\(ENV['GITHUB_WORKSPACE']\)" ~/rails/Gemfile
100
101
  echo "gem 'ostruct'" >> ~/rails/Gemfile
@@ -102,6 +103,10 @@ jobs:
102
103
  cat ~/rails/Gemfile
103
104
  bundle update --jobs=3 --retry=3
104
105
 
106
+ - name: Fix Weird Test Cases
107
+ run: |
108
+ sed -i 's|} - \[:|} - \[:distinct_on, :uniq_on, :|' ~/rails/activerecord/test/cases/relation/delegation_test.rb
109
+
105
110
  - run: |
106
111
  pushd ~/rails/activerecord
107
112
  bundle exec rake db:postgresql:rebuild postgresql:test --trace
@@ -112,6 +117,7 @@ jobs:
112
117
  runs-on: ubuntu-22.04
113
118
 
114
119
  strategy:
120
+ fail-fast: false
115
121
  matrix:
116
122
  rails: ['7.1.5.1', '7.2.2.1', '8.0.1']
117
123
  ruby-version: ['3.3']
@@ -132,7 +138,7 @@ jobs:
132
138
  cat /home/runner/work/_temp/*.sh
133
139
  sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/rails/activerecord/Rakefile
134
140
  sed -i "s/t.warning = true/t.warning = false/g" ~/rails/activerecord/Rakefile
135
- sed -i "/require 'support\/connection'/a \$LOAD_PATH.unshift\(File.expand_path\(ENV['GITHUB_WORKSPACE']\)\)\nrequire 'arel/extensions'" ~/rails/activerecord/test/cases/helper.rb
141
+ sed -i "/require \"active_record\"/a \$LOAD_PATH.unshift\(File.expand_path\(ENV['GITHUB_WORKSPACE']\)\)\nrequire 'arel/extensions'" ~/rails/activerecord/test/cases/helper.rb
136
142
  rm ~/rails/Gemfile.lock
137
143
  sed -i "/# Active Record./a gem 'arel-extensions', require: 'arel/extensions', path: File.expand_path\(ENV['GITHUB_WORKSPACE']\)" ~/rails/Gemfile
138
144
  echo "gem 'ostruct'" >> ~/rails/Gemfile
@@ -140,6 +146,14 @@ jobs:
140
146
  cat ~/rails/Gemfile
141
147
  bundle update --jobs=3 --retry=3
142
148
 
149
+ - name: Fix Weird Test Cases
150
+ run: |
151
+ sed -i 's|} - \[:|} - \[:distinct_on, :uniq_on, :|' ~/rails/activerecord/test/cases/relation/delegation_test.rb
152
+
153
+ - name: Fix Weird Test Cases
154
+ run: |
155
+ cat ~/rails/activerecord/test/cases/relation/delegation_test.rb
156
+
143
157
  - run: |
144
158
  pushd ~/rails/activerecord
145
159
  bundle exec rake sqlite3:test --trace
@@ -152,8 +166,8 @@ jobs:
152
166
  name: ActiveRecord MySQL Test
153
167
  runs-on: ubuntu-22.04
154
168
 
155
-
156
169
  strategy:
170
+ fail-fast: false
157
171
  matrix:
158
172
  rails: ['7.1.5.1', '7.2.2.1', '8.0.1']
159
173
  ruby-version: ['3.3']
@@ -180,7 +194,7 @@ jobs:
180
194
  cat /home/runner/work/_temp/*.sh
181
195
  sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/rails/activerecord/Rakefile
182
196
  sed -i "s/t.warning = true/t.warning = false/g" ~/rails/activerecord/Rakefile
183
- sed -i "/require 'support\/connection'/a \$LOAD_PATH.unshift\(File.expand_path\(ENV['GITHUB_WORKSPACE']\)\)\nrequire 'arel/extensions'" ~/rails/activerecord/test/cases/helper.rb
197
+ sed -i "/require \"active_record\"/a \$LOAD_PATH.unshift\(File.expand_path\(ENV['GITHUB_WORKSPACE']\)\)\nrequire 'arel/extensions'" ~/rails/activerecord/test/cases/helper.rb
184
198
  rm ~/rails/Gemfile.lock
185
199
  sed -i "/# Active Record./a gem 'arel-extensions', require: 'arel/extensions', path: File.expand_path\(ENV['GITHUB_WORKSPACE']\)" ~/rails/Gemfile
186
200
  echo "gem 'ostruct'" >> ~/rails/Gemfile
@@ -188,6 +202,10 @@ jobs:
188
202
  cat ~/rails/Gemfile
189
203
  bundle update --jobs=3 --retry=3
190
204
 
205
+ - name: Fix Weird Test Cases
206
+ run: |
207
+ sed -i 's|} - \[:|} - \[:distinct_on, :uniq_on, :|' ~/rails/activerecord/test/cases/relation/delegation_test.rb
208
+
191
209
  - run: |
192
210
  pushd ~/rails/activerecord
193
211
  bundle exec rake db:mysql:rebuild mysql2:test --trace
@@ -24,6 +24,8 @@ module ActiveRecord::QueryMethods
24
24
  end
25
25
  alias uniq_on! distinct_on!
26
26
 
27
+ private
28
+
27
29
  if ActiveRecord.version >= "7.2"
28
30
  def build_arel_with_distinct_on(connection, aliases = nil)
29
31
  arel = build_arel_without_distinct_on(connection, aliases)
@@ -1,5 +1,5 @@
1
1
  module Arel
2
2
  module Extensions
3
- VERSION = '8.0.1'
3
+ VERSION = '8.0.2'
4
4
  end
5
5
  end
@@ -2,6 +2,15 @@ module Arel
2
2
  module Nodes
3
3
  class RandomOrdering < Arel::Nodes::Node
4
4
 
5
+ def hash
6
+ self.class.hash
7
+ end
8
+
9
+ def eql? other
10
+ self.class == other.class
11
+ end
12
+ alias :== :eql?
13
+
5
14
  end
6
15
  end
7
16
  end
@@ -9,6 +9,17 @@ module Arel
9
9
  @language = Arel::Nodes.build_quoted(language) if language
10
10
  end
11
11
 
12
+ def hash
13
+ [@expression, @language].hash
14
+ end
15
+
16
+ def eql? other
17
+ self.class == other.class &&
18
+ self.expression == other.expression &&
19
+ self.language == other.language
20
+ end
21
+ alias :== :eql?
22
+
12
23
  end
13
24
  end
14
25
  end
@@ -9,6 +9,17 @@ module Arel
9
9
  @tsquery = tsquery
10
10
  end
11
11
 
12
+ def hash
13
+ [@tsvector, @tsquery].hash
14
+ end
15
+
16
+ def eql? other
17
+ self.class == other.class &&
18
+ self.tsvector == other.tsvector &&
19
+ self.tsquery == other.tsquery
20
+ end
21
+ alias :== :eql?
22
+
12
23
  end
13
24
  end
14
25
  end
@@ -10,6 +10,18 @@ module Arel
10
10
  @normalization = normalization
11
11
  end
12
12
 
13
+ def hash
14
+ [@tsvector, @tsquery, @normalization].hash
15
+ end
16
+
17
+ def eql? other
18
+ self.class == other.class &&
19
+ self.tsvector == other.tsvector &&
20
+ self.tsquery == other.tsquery &&
21
+ self.normalization == other.normalization
22
+ end
23
+ alias :== :eql?
24
+
13
25
  end
14
26
  end
15
27
  end
@@ -8,7 +8,17 @@ module Arel
8
8
  @attribute = attribute
9
9
  @language = Arel::Nodes.build_quoted(language) if language
10
10
  end
11
-
11
+
12
+ def hash
13
+ [@attribute, @language].hash
14
+ end
15
+
16
+ def eql? other
17
+ self.class == other.class &&
18
+ self.attribute == other.attribute &&
19
+ self.language == other.language
20
+ end
21
+ alias :== :eql?
12
22
  end
13
23
  end
14
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arel-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.1
4
+ version: 8.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy