arel_extensions 2.1.8 → 2.1.10
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/publish.yml +29 -0
- data/.github/workflows/release.yml +30 -0
- data/.github/workflows/ruby.yml +173 -147
- data/NEWS.md +37 -3
- data/README.md +4 -4
- data/bin/build +15 -0
- data/bin/publish +8 -0
- data/dev/compose.yaml +8 -0
- data/gemfiles/rails6.gemfile +4 -3
- data/gemfiles/rails6_1.gemfile +4 -3
- data/gemfiles/rails7.gemfile +9 -1
- data/gemfiles/rails7_1.gemfile +8 -0
- data/lib/arel_extensions/version.rb +1 -1
- data/lib/arel_extensions/visitors/mssql.rb +97 -61
- data/lib/arel_extensions/visitors/mysql.rb +2 -2
- data/lib/arel_extensions/visitors/postgresql.rb +2 -2
- data/lib/arel_extensions/visitors.rb +56 -61
- data/lib/arel_extensions.rb +20 -0
- data/test/arelx_test_helper.rb +20 -13
- data/test/real_db_test.rb +16 -2
- data/test/with_ar/all_agnostic_test.rb +1 -1
- data/version_v1.rb +1 -1
- data/version_v2.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f73d2ef758683ad708737ff72c92f6015d87e8e12f712b26b5b265ca14bd0d4
|
4
|
+
data.tar.gz: 06c759fd7e6609ea7d8c7cc4ff2060185d5d9e45aa9ae81f2a77b3c837a45364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a4eda851fc1a84082d55fbd8165c3faf9d5ad6cf5123581496c27eb4c2ff99a09230fcd8261a0f6c7b38b8f64c452f4394840a07d9cb67ab5d6893e59cd3f93
|
7
|
+
data.tar.gz: 83c4046e5f3cea9098328d32f5ade612f77e7b68e89c5f21f46352046b3014844cedaf86aaaf26886570f8d4f1d2319a21647dfbd61c1d08ecba12eb3aa2b3da
|
@@ -0,0 +1,29 @@
|
|
1
|
+
name: "Publish Gems"
|
2
|
+
on:
|
3
|
+
release:
|
4
|
+
types: [published]
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
publish_gems:
|
8
|
+
name: Publish to Rubygems
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v3
|
12
|
+
- name: setup ruby 3.2
|
13
|
+
uses: ruby/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: 3.2
|
16
|
+
- name: Fetch Github Release Asset
|
17
|
+
uses: dsaltares/fetch-gh-release-asset@master
|
18
|
+
with:
|
19
|
+
file: "arel_extensions.*.gem"
|
20
|
+
regex: true
|
21
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
22
|
+
- name: List gems
|
23
|
+
run: ls -l *.gem
|
24
|
+
- name: Release Gems
|
25
|
+
uses: cadwallion/publish-rubygems-action@master
|
26
|
+
env:
|
27
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
28
|
+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
29
|
+
RELEASE_COMMAND: bin/publish
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: Release
|
2
|
+
on:
|
3
|
+
workflow_run:
|
4
|
+
workflows: ["Build and Test"]
|
5
|
+
branches: [master]
|
6
|
+
types:
|
7
|
+
- completed
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build_gems:
|
11
|
+
name: Build Gemfiles
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v3
|
15
|
+
- name: setup ruby 3.2
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: 3.2
|
19
|
+
- name: build gems
|
20
|
+
run: |
|
21
|
+
bin/build
|
22
|
+
- name: release
|
23
|
+
uses: softprops/action-gh-release@v1
|
24
|
+
with:
|
25
|
+
tag_name: ${{ github.ref }}-${{ steps.vars.outputs.sha_short }}
|
26
|
+
draft: true
|
27
|
+
files: |
|
28
|
+
./arel_extensions-*.gem
|
29
|
+
env:
|
30
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
data/.github/workflows/ruby.yml
CHANGED
@@ -12,33 +12,39 @@ jobs:
|
|
12
12
|
strategy:
|
13
13
|
fail-fast: false
|
14
14
|
matrix:
|
15
|
-
versions:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
15
|
+
versions:
|
16
|
+
[
|
17
|
+
{ ruby: "3.3", rails: 7_1, arelx: 2 },
|
18
|
+
{ ruby: "3.3", rails: 7, arelx: 2 },
|
19
|
+
{ ruby: "3.3", rails: 6_1, arelx: 2 },
|
20
|
+
{ ruby: "3.2", rails: 7_1, arelx: 2 },
|
21
|
+
{ ruby: "3.2", rails: 7, arelx: 2 },
|
22
|
+
{ ruby: "3.2", rails: 6, arelx: 2 },
|
23
|
+
{ ruby: "3.2", rails: 6_1, arelx: 2 },
|
24
|
+
{ ruby: "3.1", rails: 7_1, arelx: 2 },
|
25
|
+
{ ruby: "3.1", rails: 7, arelx: 2 },
|
26
|
+
{ ruby: "3.1", rails: 6_1, arelx: 2 },
|
27
|
+
{ ruby: "3.1", rails: 6, arelx: 2 },
|
28
|
+
{ ruby: "3.0", rails: 7_1, arelx: 2 },
|
29
|
+
{ ruby: "3.0", rails: 7, arelx: 2 },
|
30
|
+
{ ruby: "3.0", rails: 6_1, arelx: 2 },
|
31
|
+
{ ruby: "2.7", rails: 7_1, arelx: 2 },
|
32
|
+
{ ruby: "2.7", rails: 7, arelx: 2 },
|
33
|
+
{ ruby: "2.7", rails: 6_1, arelx: 2 },
|
34
|
+
{ ruby: "2.7", rails: 6, arelx: 2 },
|
35
|
+
{ ruby: "2.7", rails: 5_2, arelx: 1 },
|
36
|
+
{ ruby: "2.7", rails: 4_2, arelx: 1 },
|
37
|
+
{ ruby: "2.5", rails: 6_1, arelx: 2 },
|
38
|
+
{ ruby: "2.5", rails: 6, arelx: 2 },
|
39
|
+
{ ruby: "2.5", rails: 5_2, arelx: 1 },
|
40
|
+
{ ruby: "2.5", rails: 4_2, arelx: 1 },
|
41
|
+
{ ruby: jruby-9.2, rails: 6_1, arelx: 2 },
|
42
|
+
{ ruby: jruby-9.2, rails: 6, arelx: 2 },
|
43
|
+
{ ruby: jruby-9.2, rails: 5_2, arelx: 1 },
|
44
|
+
{ ruby: jruby-9.3, rails: 6_1, arelx: 2 },
|
45
|
+
{ ruby: jruby-9.3, rails: 6, arelx: 2 },
|
46
|
+
{ ruby: jruby-9.3, rails: 5_2, arelx: 1 },
|
47
|
+
]
|
42
48
|
steps:
|
43
49
|
- uses: actions/checkout@v2
|
44
50
|
- name: Set up Ruby
|
@@ -49,9 +55,6 @@ jobs:
|
|
49
55
|
run: |
|
50
56
|
sudo apt-get update -q
|
51
57
|
sudo apt-get install -y freetds-dev
|
52
|
-
- name: Update system-wide gems
|
53
|
-
if: ${{ !contains(fromJson('["2.5", "jruby-9.2"]'), matrix.versions.ruby) }}
|
54
|
-
run: gem update --system --no-document
|
55
58
|
- name: Setup Gemfile for arelx 2.x
|
56
59
|
if: ${{ matrix.versions.arelx == 2 }}
|
57
60
|
run: |
|
@@ -71,34 +74,40 @@ jobs:
|
|
71
74
|
strategy:
|
72
75
|
fail-fast: false
|
73
76
|
matrix:
|
74
|
-
versions:
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
77
|
+
versions:
|
78
|
+
[
|
79
|
+
{ ruby: "3.3", rails: 7_1, arelx: 2 },
|
80
|
+
{ ruby: "3.3", rails: 7, arelx: 2 },
|
81
|
+
{ ruby: "3.3", rails: 6_1, arelx: 2 },
|
82
|
+
{ ruby: "3.2", rails: 7_1, arelx: 2 },
|
83
|
+
{ ruby: "3.2", rails: 7, arelx: 2 },
|
84
|
+
{ ruby: "3.2", rails: 6_1, arelx: 2 },
|
85
|
+
{ ruby: "3.2", rails: 6, arelx: 2 },
|
86
|
+
{ ruby: "3.1", rails: 7_1, arelx: 2 },
|
87
|
+
{ ruby: "3.1", rails: 7, arelx: 2 },
|
88
|
+
{ ruby: "3.1", rails: 6, arelx: 2 },
|
89
|
+
{ ruby: "3.1", rails: 6_1, arelx: 2 },
|
90
|
+
{ ruby: "3.0", rails: 7_1, arelx: 2 },
|
91
|
+
{ ruby: "3.0", rails: 7, arelx: 2 },
|
92
|
+
{ ruby: "3.0", rails: 6_1, arelx: 2 },
|
93
|
+
{ ruby: "2.7", rails: 7_1, arelx: 2 },
|
94
|
+
{ ruby: "2.7", rails: 7, arelx: 2 },
|
95
|
+
{ ruby: "2.7", rails: 6_1, arelx: 2 },
|
96
|
+
{ ruby: "2.7", rails: 6, arelx: 2 },
|
97
|
+
{ ruby: "2.7", rails: 5_2, arelx: 1 },
|
98
|
+
{ ruby: "2.7", rails: 4_2, arelx: 1 },
|
99
|
+
{ ruby: "2.5", rails: 6_1, arelx: 2 },
|
100
|
+
{ ruby: "2.5", rails: 6, arelx: 2 },
|
101
|
+
{ ruby: "2.5", rails: 5_2, arelx: 1 },
|
102
|
+
{ ruby: "2.5", rails: 4_2, arelx: 1 },
|
103
|
+
{ ruby: jruby-9.2, rails: 6_1, arelx: 2 },
|
104
|
+
{ ruby: jruby-9.2, rails: 6, arelx: 2 },
|
105
|
+
{ ruby: jruby-9.2, rails: 5_2, arelx: 1 },
|
106
|
+
{ ruby: jruby-9.2, rails: 4_2, arelx: 1 },
|
107
|
+
{ ruby: jruby-9.3, rails: 6_1, arelx: 2 },
|
108
|
+
{ ruby: jruby-9.3, rails: 6, arelx: 2 },
|
109
|
+
{ ruby: jruby-9.3, rails: 5_2, arelx: 1 },
|
110
|
+
]
|
102
111
|
steps:
|
103
112
|
- uses: actions/checkout@v2
|
104
113
|
- name: Set up Ruby
|
@@ -109,9 +118,6 @@ jobs:
|
|
109
118
|
run: |
|
110
119
|
sudo apt-get update -q
|
111
120
|
sudo apt-get install -y freetds-dev
|
112
|
-
- name: Update system-wide gems
|
113
|
-
if: ${{ !contains(fromJson('["2.5", "jruby-9.2"]'), matrix.versions.ruby) }}
|
114
|
-
run: gem update --system --no-document
|
115
121
|
- name: Setup Gemfile
|
116
122
|
if: ${{ matrix.versions.arelx == 2 }}
|
117
123
|
run: |
|
@@ -132,33 +138,38 @@ jobs:
|
|
132
138
|
fail-fast: false
|
133
139
|
matrix:
|
134
140
|
versions: [
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
141
|
+
{ ruby: "3.3", rails: 7_1, arelx: 2 },
|
142
|
+
{ ruby: "3.3", rails: 7, arelx: 2 },
|
143
|
+
{ ruby: "3.3", rails: 6_1, arelx: 2 },
|
144
|
+
{ ruby: "3.2", rails: 7_1, arelx: 2 },
|
145
|
+
{ ruby: "3.2", rails: 7, arelx: 2 },
|
146
|
+
{ ruby: "3.2", rails: 6_1, arelx: 2 },
|
147
|
+
# { ruby: "3.2", rails: 6, arelx: 2 }, # cannot test > undefined symbol: rb_tainted_str_new2
|
148
|
+
{ ruby: "3.1", rails: 7_1, arelx: 2 },
|
149
|
+
{ ruby: "3.1", rails: 7, arelx: 2 },
|
150
|
+
{ ruby: "3.1", rails: 6_1, arelx: 2 },
|
151
|
+
{ ruby: "3.1", rails: 6, arelx: 2 },
|
152
|
+
{ ruby: "3.0", rails: 7_1, arelx: 2 },
|
153
|
+
{ ruby: "3.0", rails: 7, arelx: 2 },
|
154
|
+
{ ruby: "3.0", rails: 6_1, arelx: 2 },
|
155
|
+
{ ruby: "2.7", rails: 7_1, arelx: 2 },
|
156
|
+
{ ruby: "2.7", rails: 7, arelx: 2 },
|
157
|
+
{ ruby: "2.7", rails: 6_1, arelx: 2 },
|
158
|
+
{ ruby: "2.7", rails: 6, arelx: 2 },
|
159
|
+
{ ruby: "2.7", rails: 5_2, arelx: 1 },
|
160
|
+
{ ruby: "2.7", rails: 4_2, arelx: 1 },
|
161
|
+
{ ruby: "2.5", rails: 6_1, arelx: 2 },
|
162
|
+
{ ruby: "2.5", rails: 6, arelx: 2 },
|
163
|
+
{ ruby: "2.5", rails: 5_2, arelx: 1 },
|
164
|
+
{ ruby: "2.5", rails: 4_2, arelx: 1 },
|
165
|
+
{ ruby: jruby-9.2, rails: 6_1, arelx: 2 },
|
166
|
+
{ ruby: jruby-9.2, rails: 6, arelx: 2 },
|
167
|
+
{ ruby: jruby-9.2, rails: 5_2, arelx: 1 },
|
168
|
+
{ ruby: jruby-9.2, rails: 4_2, arelx: 1 },
|
169
|
+
{ ruby: jruby-9.3, rails: 6_1, arelx: 2 },
|
170
|
+
{ ruby: jruby-9.3, rails: 6, arelx: 2 },
|
171
|
+
{ ruby: jruby-9.3, rails: 5_2, arelx: 1 },
|
172
|
+
]
|
162
173
|
steps:
|
163
174
|
- uses: actions/checkout@v2
|
164
175
|
# PostgreSQL requires locales to be installed on the system to be able
|
@@ -191,9 +202,6 @@ jobs:
|
|
191
202
|
run: |
|
192
203
|
sudo apt-get update -q
|
193
204
|
sudo apt-get install -y freetds-dev
|
194
|
-
- name: Update system-wide gems
|
195
|
-
if: ${{ !contains(fromJson('["2.5", "jruby-9.2"]'), matrix.versions.ruby) }}
|
196
|
-
run: gem update --system --no-document
|
197
205
|
- name: Setup Gemfile
|
198
206
|
if: ${{ matrix.versions.arelx == 2 }}
|
199
207
|
run: |
|
@@ -217,33 +225,38 @@ jobs:
|
|
217
225
|
fail-fast: false
|
218
226
|
matrix:
|
219
227
|
versions: [
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
228
|
+
{ ruby: "3.3", rails: 7_1, arelx: 2 },
|
229
|
+
{ ruby: "3.3", rails: 7, arelx: 2 },
|
230
|
+
{ ruby: "3.3", rails: 6_1, arelx: 2 },
|
231
|
+
{ ruby: "3.2", rails: 7_1, arelx: 2 },
|
232
|
+
{ ruby: "3.2", rails: 7, arelx: 2 },
|
233
|
+
{ ruby: "3.2", rails: 6_1, arelx: 2 },
|
234
|
+
# { ruby: "3.2", rails: 6, arelx: 2 }, # cannot test > undefined symbol: rb_tainted_str_new2
|
235
|
+
{ ruby: "3.1", rails: 7_1, arelx: 2 },
|
236
|
+
{ ruby: "3.1", rails: 7, arelx: 2 },
|
237
|
+
{ ruby: "3.1", rails: 6_1, arelx: 2 },
|
238
|
+
{ ruby: "3.1", rails: 6, arelx: 2 },
|
239
|
+
{ ruby: "3.0", rails: 7_1, arelx: 2 },
|
240
|
+
{ ruby: "3.0", rails: 7, arelx: 2 },
|
241
|
+
{ ruby: "3.0", rails: 6_1, arelx: 2 },
|
242
|
+
{ ruby: "2.7", rails: 7_1, arelx: 2 },
|
243
|
+
{ ruby: "2.7", rails: 7, arelx: 2 },
|
244
|
+
{ ruby: "2.7", rails: 6_1, arelx: 2 },
|
245
|
+
{ ruby: "2.7", rails: 6, arelx: 2 },
|
246
|
+
{ ruby: "2.7", rails: 5_2, arelx: 1 },
|
247
|
+
{ ruby: "2.7", rails: 4_2, arelx: 1 },
|
248
|
+
{ ruby: "2.5", rails: 6_1, arelx: 2 },
|
249
|
+
{ ruby: "2.5", rails: 6, arelx: 2 },
|
250
|
+
{ ruby: "2.5", rails: 5_2, arelx: 1 },
|
251
|
+
{ ruby: "2.5", rails: 4_2, arelx: 1 },
|
252
|
+
{ ruby: jruby-9.2, rails: 6_1, arelx: 2 },
|
253
|
+
{ ruby: jruby-9.2, rails: 6, arelx: 2 },
|
254
|
+
{ ruby: jruby-9.2, rails: 5_2, arelx: 1 },
|
255
|
+
{ ruby: jruby-9.2, rails: 4_2, arelx: 1 },
|
256
|
+
{ ruby: jruby-9.3, rails: 6_1, arelx: 2 },
|
257
|
+
{ ruby: jruby-9.3, rails: 6, arelx: 2 },
|
258
|
+
{ ruby: jruby-9.3, rails: 5_2, arelx: 1 },
|
259
|
+
]
|
247
260
|
services:
|
248
261
|
mysql:
|
249
262
|
image: mysql:5.7
|
@@ -268,9 +281,6 @@ jobs:
|
|
268
281
|
run: |
|
269
282
|
sudo apt-get update -q
|
270
283
|
sudo apt-get install -y freetds-dev
|
271
|
-
- name: Update system-wide gems
|
272
|
-
if: ${{ !contains(fromJson('["2.5", "jruby-9.2"]'), matrix.versions.ruby) }}
|
273
|
-
run: gem update --system --no-document
|
274
284
|
- name: Setup Gemfile
|
275
285
|
if: ${{ matrix.versions.arelx == 2 }}
|
276
286
|
run: |
|
@@ -297,29 +307,48 @@ jobs:
|
|
297
307
|
fail-fast: false
|
298
308
|
matrix:
|
299
309
|
versions: [
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
310
|
+
{ ruby: "3.3", rails: 7_1, arelx: 2 },
|
311
|
+
{ ruby: "3.3", rails: 7, arelx: 2 },
|
312
|
+
{ ruby: "3.3", rails: 6_1, arelx: 2 },
|
313
|
+
{ ruby: "3.3", rails: 6, arelx: 2 },
|
314
|
+
{ ruby: "3.2", rails: 7_1, arelx: 2 },
|
315
|
+
{ ruby: "3.2", rails: 7, arelx: 2 },
|
316
|
+
{ ruby: "3.2", rails: 6_1, arelx: 2 },
|
317
|
+
{ ruby: "3.2", rails: 6, arelx: 2 },
|
318
|
+
{ ruby: "3.1", rails: 7_1, arelx: 2 },
|
319
|
+
{ ruby: "3.1", rails: 7, arelx: 2 },
|
320
|
+
{ ruby: "3.1", rails: 6_1, arelx: 2 },
|
321
|
+
{ ruby: "3.1", rails: 6, arelx: 2 },
|
322
|
+
{ ruby: "3.0", rails: 7, arelx: 2 },
|
323
|
+
{ ruby: "3.0", rails: 6_1, arelx: 2 },
|
324
|
+
{ ruby: "3.0", rails: 6, arelx: 2 },
|
325
|
+
{ ruby: "2.7", rails: 6_1, arelx: 2 },
|
326
|
+
{ ruby: "2.7", rails: 6, arelx: 2 },
|
327
|
+
{ ruby: "2.7", rails: 5_2, arelx: 1 },
|
328
|
+
{ ruby: "2.7", rails: 4_2, arelx: 1 },
|
329
|
+
{ ruby: "2.5", rails: 6_1, arelx: 2 },
|
330
|
+
{ ruby: "2.5", rails: 6, arelx: 2 },
|
331
|
+
{ ruby: "2.5", rails: 5_2, arelx: 1 },
|
332
|
+
{ ruby: "2.5", rails: 4_2, arelx: 1 },
|
333
|
+
# {ruby: jruby-9.2, rails: 6_1, arelx: 2},
|
334
|
+
# {ruby: jruby-9.2, rails: 6, arelx: 2},
|
335
|
+
{ ruby: jruby-9.2, rails: 5_2, arelx: 1 },
|
336
|
+
{ ruby: jruby-9.2, rails: 4_2, arelx: 1 },
|
337
|
+
# See comments on 9.4 to understand why these are disabled for now.
|
338
|
+
# {ruby: jruby-9.3, rails: 6_1, arelx: 2},
|
339
|
+
# {ruby: jruby-9.3, rails: 6, arelx: 2},
|
340
|
+
# {ruby: jruby-9.3, rails: 5_2, arelx: 1},
|
341
|
+
{ ruby: jruby-9.4, rails: 7_1, arelx: 2 },
|
342
|
+
{ ruby: jruby-9.4, rails: 7, arelx: 2 },
|
343
|
+
#
|
344
|
+
# 6 and 6.1 don't work because of a bug in the alt adapter
|
345
|
+
# https://github.com/JesseChavez/activerecord-jdbc-adapter/issues/16
|
346
|
+
# {ruby: jruby-9.4, rails: 6_1, arelx: 2},
|
347
|
+
# {ruby: jruby-9.4, rails: 6, arelx: 2},
|
348
|
+
#
|
349
|
+
# < 5.2 don't work because of a deeper issue.
|
350
|
+
# {ruby: jruby-9.4, rails: 5_2, arelx: 1},
|
351
|
+
]
|
323
352
|
mssql: [2017, 2019]
|
324
353
|
steps:
|
325
354
|
- uses: actions/checkout@v2
|
@@ -337,9 +366,6 @@ jobs:
|
|
337
366
|
version: ${{ matrix.mssql }}
|
338
367
|
install: sqlengine, sqlclient, sqlpackage, localdb
|
339
368
|
sa-password: Password12!
|
340
|
-
- name: Update system-wide gems
|
341
|
-
if: ${{ !contains(fromJson('["2.5", "jruby-9.2"]'), matrix.versions.ruby) }}
|
342
|
-
run: gem update --system --no-document
|
343
369
|
- name: Setup Gemfile
|
344
370
|
if: ${{ matrix.versions.arelx == 2 }}
|
345
371
|
run: |
|
data/NEWS.md
CHANGED
@@ -1,6 +1,40 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
-
##
|
3
|
+
## Release v2.1.10/v1.3.10
|
4
|
+
|
5
|
+
- MS SQL: add support for jruby 9.4 via [activerecord-jdbc-alt-adapter](https://rubygems.org/gems/activerecord-jdbc-alt-adapter/)
|
6
|
+
|
7
|
+
## Release v2.1.9/v1.3.9
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
- Postgres:
|
12
|
+
- Datetime formatting in postgres now behaves like mysql: if the target
|
13
|
+
timezone is a string, we automatically consider that you're trying to
|
14
|
+
convert from `UTC`.
|
15
|
+
- Datetime casting will now automatically ask for a
|
16
|
+
`timestamp without timezone`, also aligning with the expected befavior
|
17
|
+
in mysql. This also makes casting work better with timezone conversion,
|
18
|
+
especially if you don't pass the timezone from which you're converting
|
19
|
+
to.
|
20
|
+
```ruby
|
21
|
+
scope
|
22
|
+
.select(Arel.quoted('2022-02-01 10:42:00')
|
23
|
+
.cast(:datetime)
|
24
|
+
.format_date('%Y/%m/%d %H:%M:%S', 'Europe/Paris')
|
25
|
+
.as('res'))
|
26
|
+
```
|
27
|
+
Will produce:
|
28
|
+
```sql
|
29
|
+
SELECT TO_CHAR(
|
30
|
+
CAST('2022-02-01 10:42:00' AS timestamp without time zone) AT TIME ZONE 'UTC' AT TIME ZONE 'Europe/Paris',
|
31
|
+
'YYYY/MM/DD HH24:MI:SS'
|
32
|
+
)
|
33
|
+
AS "res"
|
34
|
+
-- …
|
35
|
+
```
|
36
|
+
|
37
|
+
## Release v2.1.7/v1.3.7
|
4
38
|
|
5
39
|
### New Features
|
6
40
|
|
@@ -8,11 +42,11 @@
|
|
8
42
|
The actual behavior of `format` is inconsistent across DB vendors: in mysql we
|
9
43
|
can format dates and numbers with it, and in the other ones we only format
|
10
44
|
dates.
|
11
|
-
|
45
|
+
|
12
46
|
We're planning on normalizing this behavior. We want `format` to "cleverly"
|
13
47
|
format dates or numbers, and `format_date` / `format_number` to strictly
|
14
48
|
format dates / numbers.
|
15
|
-
|
49
|
+
|
16
50
|
The introduction of `format_date` is the first step in this direction.
|
17
51
|
|
18
52
|
## Release v2.1.6/v1.3.6
|
data/README.md
CHANGED
@@ -173,9 +173,9 @@ The second form accepts 2 kinds of values:
|
|
173
173
|
|
174
174
|
```ruby
|
175
175
|
t[:birthdate].format('%Y/%m/%d %H:%M:%S', 'posix/Pacific/Tahiti')
|
176
|
-
# => DATE_FORMAT(CONVERT_TZ(CAST(my_table.birthdate AS datetime), 'UTC', 'posix/Pacific/Tahiti'), '%Y/%m/%d %H:%i:%S')
|
177
|
-
# => TO_CHAR(CAST(my_table.birthdate AS timestamp with time zone) AT TIME ZONE 'posix/Pacific/Tahiti', 'YYYY/MM/DD HH24:MI:SS') ## PostgreSQL
|
178
|
-
# => CONVERT(datetime, my_table.birthdate) AT TIME ZONE 'UTC' AT TIME ZONE N'posix/Pacific/Tahiti'
|
176
|
+
# => DATE_FORMAT(CONVERT_TZ(CAST(my_table.birthdate AS datetime), 'UTC', 'posix/Pacific/Tahiti'), '%Y/%m/%d %H:%i:%S') ## MySQL
|
177
|
+
# => TO_CHAR(CAST(my_table.birthdate AS timestamp with time zone) AT TIME ZONE 'UTC' AT TIME ZONE 'posix/Pacific/Tahiti', 'YYYY/MM/DD HH24:MI:SS') ## PostgreSQL
|
178
|
+
# => CONVERT(datetime, my_table.birthdate) AT TIME ZONE 'UTC' AT TIME ZONE N'posix/Pacific/Tahiti' ## SQL Server (& truncated for clarity)
|
179
179
|
# ^^^^^^^^^^^^^^^^^^^^ 🚨 Invalid timezone for SQL Server. Explanation below.
|
180
180
|
```
|
181
181
|
|
@@ -772,7 +772,7 @@ bundle exec rake test:to_sql
|
|
772
772
|
Refer to the [Version Compatibility](#version-compatibility) section to correctly
|
773
773
|
set your gemfile.
|
774
774
|
|
775
|
-
###
|
775
|
+
### Testing databases locally
|
776
776
|
|
777
777
|
We provide a `docker compose` to set up some databases for testing:
|
778
778
|
|
data/bin/build
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#! /usr/bin/env sh
|
2
|
+
set -e
|
3
|
+
|
4
|
+
# VERSION ~> 1
|
5
|
+
echo "Packaging v1"
|
6
|
+
cp ./version_v1.rb lib/arel_extensions/version.rb
|
7
|
+
cp ./gemspecs/arel_extensions-v1.gemspec ./arel_extensions.gemspec
|
8
|
+
gem build ./arel_extensions.gemspec
|
9
|
+
|
10
|
+
# VERSION ~> 2
|
11
|
+
echo "Packaging v2"
|
12
|
+
cp ./version_v2.rb lib/arel_extensions/version.rb
|
13
|
+
cp ./gemspecs/arel_extensions-v2.gemspec ./arel_extensions.gemspec
|
14
|
+
gem build ./arel_extensions.gemspec
|
15
|
+
|
data/bin/publish
ADDED
data/dev/compose.yaml
CHANGED
data/gemfiles/rails6.gemfile
CHANGED
@@ -20,11 +20,12 @@ group :development, :test do
|
|
20
20
|
gem 'activerecord-oracle_enhanced-adapter', '~> 6.0.0' if ENV.has_key? 'ORACLE_HOME'
|
21
21
|
|
22
22
|
# for JRuby
|
23
|
-
gem 'activerecord-jdbc-adapter',
|
24
|
-
gem 'jdbc-sqlite3', platforms: :jruby
|
25
|
-
gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
|
23
|
+
gem 'activerecord-jdbc-alt-adapter', '~> 60.0', platform: :jruby, require: true
|
26
24
|
gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
|
27
25
|
gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
|
26
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
|
27
|
+
gem 'jdbc-mssql', platforms: :jruby, require: true
|
28
|
+
gem 'jdbc-sqlite3', platforms: :jruby
|
28
29
|
end
|
29
30
|
|
30
31
|
gemspec path: Dir.pwd
|
data/gemfiles/rails6_1.gemfile
CHANGED
@@ -20,11 +20,12 @@ group :development, :test do
|
|
20
20
|
gem 'activerecord-oracle_enhanced-adapter', '~> 6.0.0' if ENV.has_key? 'ORACLE_HOME'
|
21
21
|
|
22
22
|
# for JRuby
|
23
|
-
gem 'activerecord-jdbc-adapter',
|
24
|
-
gem 'jdbc-sqlite3', platforms: :jruby
|
25
|
-
gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
|
23
|
+
gem 'activerecord-jdbc-alt-adapter', '~> 61.0', platform: :jruby, require: true
|
26
24
|
gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
|
27
25
|
gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
|
26
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
|
27
|
+
gem 'jdbc-mssql', platforms: :jruby, require: true
|
28
|
+
gem 'jdbc-sqlite3', platforms: :jruby
|
28
29
|
end
|
29
30
|
|
30
31
|
gemspec path: Dir.pwd
|