arel_extensions 2.1.5 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +141 -153
- data/NEWS.md +15 -0
- data/README.md +119 -76
- data/appveyor.yml +9 -0
- data/arel_extensions.gemspec +0 -1
- data/gemfiles/{rails4.gemfile → rails4_2.gemfile} +12 -3
- data/gemfiles/{rails5_0.gemfile → rails5.gemfile} +0 -0
- data/gemspecs/arel_extensions-v1.gemspec +0 -1
- data/gemspecs/arel_extensions-v2.gemspec +0 -1
- data/lib/arel_extensions/nodes/case.rb +4 -3
- data/lib/arel_extensions/nodes/rollup.rb +36 -0
- data/lib/arel_extensions/nodes/select.rb +10 -0
- data/lib/arel_extensions/null_functions.rb +16 -0
- data/lib/arel_extensions/string_functions.rb +1 -0
- data/lib/arel_extensions/version.rb +1 -1
- data/lib/arel_extensions/visitors/mssql.rb +93 -0
- data/lib/arel_extensions/visitors/mysql.rb +63 -1
- data/lib/arel_extensions/visitors/oracle.rb +17 -0
- data/lib/arel_extensions/visitors.rb +8 -0
- data/lib/arel_extensions.rb +16 -0
- data/test/with_ar/all_agnostic_test.rb +110 -10
- data/version_v1.rb +1 -1
- data/version_v2.rb +1 -1
- metadata +7 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c31abd9b0c4ea7cfe26860fba2149ba9a998340e5a34e782a4e0f6790f466fb
|
4
|
+
data.tar.gz: 045325b9361956a6f07f24b252aa2328dada7bb9a3ffd5b75cb59bb8d65fbdbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8988d1d77e9213dd6fbf36921604dd684d5ff624862a1be8c200cbd6c77233e9ae1130642eb711e92804862eefcc386c204dee765e541ca5290bf7d0ce5afabb
|
7
|
+
data.tar.gz: 918c39d67c2f3b1a1f9335818858d503072e34cda34d4112bac482c36d715258570a0a46c7b1a802893f57a9245af385e3a4f8c819548d2c716a02e9fe28032e
|
data/.github/workflows/ruby.yml
CHANGED
@@ -6,159 +6,139 @@ name: Build and Test
|
|
6
6
|
on: [push, pull_request]
|
7
7
|
|
8
8
|
jobs:
|
9
|
-
job_build_gem:
|
10
|
-
name: build
|
11
|
-
runs-on: ubuntu-latest
|
12
|
-
strategy:
|
13
|
-
matrix:
|
14
|
-
ruby: [3.1, 3.0, 2.7, 2.5, jruby-9.2, jruby-9.3]
|
15
|
-
rails: [7, 6_1, 6, 5_2]
|
16
|
-
exclude: [
|
17
|
-
{ruby: 3.1, rails: 6 },
|
18
|
-
{ruby: 3.1, rails: 5_2},
|
19
|
-
{ruby: 3.0, rails: 6 },
|
20
|
-
{ruby: 3.0, rails: 5_2},
|
21
|
-
{ruby: 2.7, rails: 5_2},
|
22
|
-
{ruby: 2.5, rails: 7 },
|
23
|
-
{ruby: jruby-9.2, rails: 7 },
|
24
|
-
{ruby: jruby-9.3, rails: 7 },
|
25
|
-
]
|
26
|
-
steps:
|
27
|
-
- uses: actions/checkout@v2
|
28
|
-
- name: Set up Ruby
|
29
|
-
uses: ruby/setup-ruby@v1
|
30
|
-
with:
|
31
|
-
ruby-version: ${{ matrix.ruby }}
|
32
|
-
- name: Setup gemspec
|
33
|
-
if: ${{ matrix.rails != '5_2' }}
|
34
|
-
run: |
|
35
|
-
cp ./gemspecs/arel_extensions-v2.gemspec ./arel_extensions.gemspec
|
36
|
-
cp ./version_v2.rb lib/arel_extensions/version.rb
|
37
|
-
cp ./gemfiles/rails${{ matrix.rails }}.gemfile ./Gemfile
|
38
|
-
- name: Build source gem
|
39
|
-
run: gem build arel_extensions.gemspec
|
40
|
-
- name: Upload source gem
|
41
|
-
uses: actions/upload-artifact@v2
|
42
|
-
with:
|
43
|
-
name: ${{ matrix.ruby }}-${{ matrix.rails }}-gem
|
44
|
-
path: "*.gem"
|
45
|
-
|
46
9
|
job_test_to_sql:
|
47
10
|
name: test to_sql
|
48
|
-
needs: job_build_gem
|
49
11
|
runs-on: ubuntu-latest
|
50
12
|
strategy:
|
51
13
|
fail-fast: false
|
52
14
|
matrix:
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
{ruby: 3.
|
57
|
-
{ruby: 3.
|
58
|
-
{ruby:
|
59
|
-
{ruby:
|
60
|
-
{ruby: 2.7, rails:
|
61
|
-
{ruby: 2.
|
62
|
-
{ruby:
|
63
|
-
{ruby:
|
15
|
+
versions: [
|
16
|
+
{ruby: 3.1, rails: 7, arelx: 2},
|
17
|
+
{ruby: 3.1, rails: 6_1, arelx: 2},
|
18
|
+
{ruby: 3.0, rails: 7, arelx: 2},
|
19
|
+
{ruby: 3.0, rails: 6_1, arelx: 2},
|
20
|
+
{ruby: 2.7, rails: 7, arelx: 2},
|
21
|
+
{ruby: 2.7, rails: 6_1, arelx: 2},
|
22
|
+
{ruby: 2.7, rails: 6, arelx: 2},
|
23
|
+
{ruby: 2.7, rails: 5_2, arelx: 1},
|
24
|
+
{ruby: 2.7, rails: 4_2, arelx: 1},
|
25
|
+
{ruby: 2.5, rails: 6_1, arelx: 2},
|
26
|
+
{ruby: 2.5, rails: 6, arelx: 2},
|
27
|
+
{ruby: 2.5, rails: 5_2, arelx: 1},
|
28
|
+
{ruby: 2.5, rails: 4_2, arelx: 1},
|
29
|
+
{ruby: jruby-9.2, rails: 6_1, arelx: 2},
|
30
|
+
{ruby: jruby-9.2, rails: 6, arelx: 2},
|
31
|
+
{ruby: jruby-9.2, rails: 5_2, arelx: 1},
|
32
|
+
{ruby: jruby-9.3, rails: 6_1, arelx: 2},
|
33
|
+
{ruby: jruby-9.3, rails: 6, arelx: 2},
|
34
|
+
{ruby: jruby-9.3, rails: 5_2, arelx: 1},
|
64
35
|
]
|
65
36
|
steps:
|
66
37
|
- uses: actions/checkout@v2
|
67
38
|
- name: Set up Ruby
|
68
39
|
uses: ruby/setup-ruby@v1
|
69
40
|
with:
|
70
|
-
ruby-version: ${{ matrix.ruby }}
|
41
|
+
ruby-version: ${{ matrix.versions.ruby }}
|
71
42
|
- name: Install FreeTDS
|
72
43
|
run: |
|
73
44
|
sudo apt-get update -q
|
74
45
|
sudo apt-get install -y freetds-dev
|
75
46
|
- name: Update system-wide gems
|
76
|
-
run: gem update --system
|
77
|
-
- name:
|
78
|
-
|
79
|
-
with:
|
80
|
-
name: ${{ matrix.ruby }}-${{ matrix.rails }}-gem
|
81
|
-
- name: Setup Gemfile
|
82
|
-
if: ${{ matrix.rails != '5_2' }}
|
47
|
+
run: gem update --system --no-document
|
48
|
+
- name: Setup Gemfile for arelx 2.x
|
49
|
+
if: ${{ matrix.versions.arelx == 2 }}
|
83
50
|
run: |
|
84
51
|
cp ./gemspecs/arel_extensions-v2.gemspec ./arel_extensions.gemspec
|
85
52
|
cp ./version_v2.rb lib/arel_extensions/version.rb
|
86
|
-
cp ./gemfiles/rails${{ matrix.rails }}.gemfile ./Gemfile
|
53
|
+
cp ./gemfiles/rails${{ matrix.versions.rails }}.gemfile ./Gemfile
|
87
54
|
- name: bundle install
|
88
55
|
run: |
|
89
|
-
bundle config set gemfile ./gemfiles/rails${{ matrix.rails }}.gemfile
|
56
|
+
bundle config set gemfile ./gemfiles/rails${{ matrix.versions.rails }}.gemfile
|
90
57
|
bundle install
|
91
58
|
- name: Run test to_sql
|
92
59
|
run: bundle exec rake test:to_sql
|
93
60
|
|
94
61
|
job_test_sqlite:
|
95
62
|
name: test sqlite
|
96
|
-
needs: job_build_gem
|
97
63
|
runs-on: ubuntu-latest
|
98
64
|
strategy:
|
99
65
|
fail-fast: false
|
100
66
|
matrix:
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
{ruby: 3.
|
105
|
-
{ruby: 3.
|
106
|
-
{ruby:
|
107
|
-
{ruby:
|
108
|
-
{ruby: 2.7, rails:
|
109
|
-
{ruby: 2.
|
110
|
-
{ruby:
|
111
|
-
{ruby:
|
67
|
+
versions: [
|
68
|
+
{ruby: 3.1, rails: 7, arelx: 2},
|
69
|
+
{ruby: 3.1, rails: 6_1, arelx: 2},
|
70
|
+
{ruby: 3.0, rails: 7, arelx: 2},
|
71
|
+
{ruby: 3.0, rails: 6_1, arelx: 2},
|
72
|
+
{ruby: 2.7, rails: 7, arelx: 2},
|
73
|
+
{ruby: 2.7, rails: 6_1, arelx: 2},
|
74
|
+
{ruby: 2.7, rails: 6, arelx: 2},
|
75
|
+
{ruby: 2.7, rails: 5_2, arelx: 1},
|
76
|
+
{ruby: 2.7, rails: 4_2, arelx: 1},
|
77
|
+
{ruby: 2.5, rails: 6_1, arelx: 2},
|
78
|
+
{ruby: 2.5, rails: 6, arelx: 2},
|
79
|
+
{ruby: 2.5, rails: 5_2, arelx: 1},
|
80
|
+
{ruby: 2.5, rails: 4_2, arelx: 1},
|
81
|
+
{ruby: jruby-9.2, rails: 6_1, arelx: 2},
|
82
|
+
{ruby: jruby-9.2, rails: 6, arelx: 2},
|
83
|
+
{ruby: jruby-9.2, rails: 5_2, arelx: 1},
|
84
|
+
{ruby: jruby-9.2, rails: 4_2, arelx: 1},
|
85
|
+
{ruby: jruby-9.3, rails: 6_1, arelx: 2},
|
86
|
+
{ruby: jruby-9.3, rails: 6, arelx: 2},
|
87
|
+
{ruby: jruby-9.3, rails: 5_2, arelx: 1},
|
112
88
|
]
|
113
89
|
steps:
|
114
90
|
- uses: actions/checkout@v2
|
115
91
|
- name: Set up Ruby
|
116
92
|
uses: ruby/setup-ruby@v1
|
117
93
|
with:
|
118
|
-
ruby-version: ${{ matrix.ruby }}
|
94
|
+
ruby-version: ${{ matrix.versions.ruby }}
|
119
95
|
- name: Install FreeTDS
|
120
96
|
run: |
|
121
97
|
sudo apt-get update -q
|
122
98
|
sudo apt-get install -y freetds-dev
|
123
99
|
- name: Update system-wide gems
|
124
|
-
run: gem update --system
|
125
|
-
- name: Download gem from build job
|
126
|
-
uses: actions/download-artifact@v2
|
127
|
-
with:
|
128
|
-
name: ${{ matrix.ruby }}-${{ matrix.rails }}-gem
|
100
|
+
run: gem update --system --no-document
|
129
101
|
- name: Setup Gemfile
|
130
|
-
if: ${{ matrix.
|
102
|
+
if: ${{ matrix.versions.arelx == 2 }}
|
131
103
|
run: |
|
132
104
|
cp ./gemspecs/arel_extensions-v2.gemspec ./arel_extensions.gemspec
|
133
105
|
cp ./version_v2.rb lib/arel_extensions/version.rb
|
134
|
-
cp ./gemfiles/rails${{ matrix.rails }}.gemfile ./Gemfile
|
106
|
+
cp ./gemfiles/rails${{ matrix.versions.rails }}.gemfile ./Gemfile
|
135
107
|
- name: bundle install
|
136
108
|
run: |
|
137
|
-
bundle config set gemfile ./gemfiles/rails${{ matrix.rails }}.gemfile
|
109
|
+
bundle config set gemfile ./gemfiles/rails${{ matrix.versions.rails }}.gemfile
|
138
110
|
bundle install
|
139
111
|
- name: Run test sqlite
|
140
112
|
run: bundle exec rake test:sqlite
|
141
113
|
|
142
114
|
job_test_postgres:
|
143
115
|
name: test postgres
|
144
|
-
needs: job_build_gem
|
145
116
|
runs-on: ubuntu-latest
|
146
117
|
strategy:
|
147
118
|
fail-fast: false
|
148
119
|
matrix:
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
120
|
+
versions: [
|
121
|
+
{ruby: 3.1, rails: 7, arelx: 2},
|
122
|
+
{ruby: 3.1, rails: 6_1, arelx: 2},
|
123
|
+
{ruby: 3.0, rails: 7, arelx: 2},
|
124
|
+
{ruby: 3.0, rails: 6_1, arelx: 2},
|
125
|
+
{ruby: 2.7, rails: 7, arelx: 2},
|
126
|
+
{ruby: 2.7, rails: 6_1, arelx: 2},
|
127
|
+
{ruby: 2.7, rails: 6, arelx: 2},
|
128
|
+
{ruby: 2.7, rails: 5_2, arelx: 1},
|
129
|
+
{ruby: 2.7, rails: 4_2, arelx: 1},
|
130
|
+
{ruby: 2.5, rails: 6_1, arelx: 2},
|
131
|
+
{ruby: 2.5, rails: 6, arelx: 2},
|
132
|
+
{ruby: 2.5, rails: 5_2, arelx: 1},
|
133
|
+
{ruby: 2.5, rails: 4_2, arelx: 1},
|
134
|
+
{ruby: jruby-9.2, rails: 6_1, arelx: 2},
|
135
|
+
{ruby: jruby-9.2, rails: 6, arelx: 2},
|
136
|
+
{ruby: jruby-9.2, rails: 5_2, arelx: 1},
|
137
|
+
{ruby: jruby-9.2, rails: 4_2, arelx: 1},
|
138
|
+
{ruby: jruby-9.3, rails: 6_1, arelx: 2},
|
139
|
+
{ruby: jruby-9.3, rails: 6, arelx: 2},
|
140
|
+
{ruby: jruby-9.3, rails: 5_2, arelx: 1},
|
141
|
+
]
|
162
142
|
steps:
|
163
143
|
- uses: actions/checkout@v2
|
164
144
|
# PostgreSQL requires locales to be installed on the system to be able
|
@@ -186,26 +166,22 @@ jobs:
|
|
186
166
|
- name: Set up Ruby
|
187
167
|
uses: ruby/setup-ruby@v1
|
188
168
|
with:
|
189
|
-
ruby-version: ${{ matrix.ruby }}
|
169
|
+
ruby-version: ${{ matrix.versions.ruby }}
|
190
170
|
- name: Install FreeTDS
|
191
171
|
run: |
|
192
172
|
sudo apt-get update -q
|
193
173
|
sudo apt-get install -y freetds-dev
|
194
174
|
- name: Update system-wide gems
|
195
|
-
run: gem update --system
|
196
|
-
- name: Download gem from build job
|
197
|
-
uses: actions/download-artifact@v2
|
198
|
-
with:
|
199
|
-
name: ${{ matrix.ruby }}-${{ matrix.rails }}-gem
|
175
|
+
run: gem update --system --no-document
|
200
176
|
- name: Setup Gemfile
|
201
|
-
if: ${{ matrix.
|
177
|
+
if: ${{ matrix.versions.arelx == 2 }}
|
202
178
|
run: |
|
203
179
|
cp ./gemspecs/arel_extensions-v2.gemspec ./arel_extensions.gemspec
|
204
180
|
cp ./version_v2.rb lib/arel_extensions/version.rb
|
205
|
-
cp ./gemfiles/rails${{ matrix.rails }}.gemfile ./Gemfile
|
181
|
+
cp ./gemfiles/rails${{ matrix.versions.rails }}.gemfile ./Gemfile
|
206
182
|
- name: bundle install
|
207
183
|
run: |
|
208
|
-
bundle config set gemfile ./gemfiles/rails${{ matrix.rails }}.gemfile
|
184
|
+
bundle config set gemfile ./gemfiles/rails${{ matrix.versions.rails }}.gemfile
|
209
185
|
bundle install
|
210
186
|
- name: Run test Postgres
|
211
187
|
env:
|
@@ -215,22 +191,31 @@ jobs:
|
|
215
191
|
|
216
192
|
job_test_mysql:
|
217
193
|
name: test mysql
|
218
|
-
needs: job_build_gem
|
219
194
|
runs-on: ubuntu-latest
|
220
195
|
strategy:
|
221
196
|
fail-fast: false
|
222
197
|
matrix:
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
{ruby: 3.
|
227
|
-
{ruby: 3.
|
228
|
-
{ruby:
|
229
|
-
{ruby:
|
230
|
-
{ruby: 2.7, rails:
|
231
|
-
{ruby: 2.
|
232
|
-
{ruby:
|
233
|
-
{ruby:
|
198
|
+
versions: [
|
199
|
+
{ruby: 3.1, rails: 7, arelx: 2},
|
200
|
+
{ruby: 3.1, rails: 6_1, arelx: 2},
|
201
|
+
{ruby: 3.0, rails: 7, arelx: 2},
|
202
|
+
{ruby: 3.0, rails: 6_1, arelx: 2},
|
203
|
+
{ruby: 2.7, rails: 7, arelx: 2},
|
204
|
+
{ruby: 2.7, rails: 6_1, arelx: 2},
|
205
|
+
{ruby: 2.7, rails: 6, arelx: 2},
|
206
|
+
{ruby: 2.7, rails: 5_2, arelx: 1},
|
207
|
+
{ruby: 2.7, rails: 4_2, arelx: 1},
|
208
|
+
{ruby: 2.5, rails: 6_1, arelx: 2},
|
209
|
+
{ruby: 2.5, rails: 6, arelx: 2},
|
210
|
+
{ruby: 2.5, rails: 5_2, arelx: 1},
|
211
|
+
{ruby: 2.5, rails: 4_2, arelx: 1},
|
212
|
+
{ruby: jruby-9.2, rails: 6_1, arelx: 2},
|
213
|
+
{ruby: jruby-9.2, rails: 6, arelx: 2},
|
214
|
+
{ruby: jruby-9.2, rails: 5_2, arelx: 1},
|
215
|
+
{ruby: jruby-9.2, rails: 4_2, arelx: 1},
|
216
|
+
{ruby: jruby-9.3, rails: 6_1, arelx: 2},
|
217
|
+
{ruby: jruby-9.3, rails: 6, arelx: 2},
|
218
|
+
{ruby: jruby-9.3, rails: 5_2, arelx: 1},
|
234
219
|
]
|
235
220
|
services:
|
236
221
|
mysql:
|
@@ -251,26 +236,22 @@ jobs:
|
|
251
236
|
- name: Set up Ruby
|
252
237
|
uses: ruby/setup-ruby@v1
|
253
238
|
with:
|
254
|
-
ruby-version: ${{ matrix.ruby }}
|
239
|
+
ruby-version: ${{ matrix.versions.ruby }}
|
255
240
|
- name: Install FreeTDS
|
256
241
|
run: |
|
257
242
|
sudo apt-get update -q
|
258
243
|
sudo apt-get install -y freetds-dev
|
259
244
|
- name: Update system-wide gems
|
260
|
-
run: gem update --system
|
261
|
-
- name: Download gem from build job
|
262
|
-
uses: actions/download-artifact@v2
|
263
|
-
with:
|
264
|
-
name: ${{ matrix.ruby }}-${{ matrix.rails }}-gem
|
245
|
+
run: gem update --system --no-document
|
265
246
|
- name: Setup Gemfile
|
266
|
-
if: ${{ matrix.
|
247
|
+
if: ${{ matrix.versions.arelx == 2 }}
|
267
248
|
run: |
|
268
249
|
cp ./gemspecs/arel_extensions-v2.gemspec ./arel_extensions.gemspec
|
269
250
|
cp ./version_v2.rb lib/arel_extensions/version.rb
|
270
|
-
cp ./gemfiles/rails${{ matrix.rails }}.gemfile ./Gemfile
|
251
|
+
cp ./gemfiles/rails${{ matrix.versions.rails }}.gemfile ./Gemfile
|
271
252
|
- name: bundle install
|
272
253
|
run: |
|
273
|
-
bundle config set gemfile ./gemfiles/rails${{ matrix.rails }}.gemfile
|
254
|
+
bundle config set gemfile ./gemfiles/rails${{ matrix.versions.rails }}.gemfile
|
274
255
|
bundle install
|
275
256
|
- name: Run test MySql
|
276
257
|
env:
|
@@ -283,59 +264,66 @@ jobs:
|
|
283
264
|
|
284
265
|
job_test_mssql:
|
285
266
|
name: test mssql on linux
|
286
|
-
needs: job_build_gem
|
287
267
|
runs-on: ubuntu-latest
|
288
268
|
strategy:
|
289
269
|
fail-fast: false
|
290
270
|
matrix:
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
{ruby: 3.
|
296
|
-
{ruby:
|
297
|
-
{ruby:
|
298
|
-
{ruby:
|
299
|
-
{ruby: 2.7,
|
300
|
-
|
301
|
-
|
302
|
-
{ruby:
|
303
|
-
{ruby:
|
304
|
-
|
305
|
-
{ruby: jruby-9.
|
306
|
-
{ruby: jruby-9.
|
271
|
+
versions: [
|
272
|
+
# {ruby: 3.1, rails: 7, arelx: 2},
|
273
|
+
{ruby: 3.1, rails: 6_1, arelx: 2},
|
274
|
+
# {ruby: 3.0, rails: 7, arelx: 2},
|
275
|
+
{ruby: 3.0, rails: 6_1, arelx: 2},
|
276
|
+
# {ruby: 2.7, rails: 7, arelx: 2},
|
277
|
+
{ruby: 2.7, rails: 6_1, arelx: 2},
|
278
|
+
{ruby: 2.7, rails: 6, arelx: 2},
|
279
|
+
{ruby: 2.7, rails: 5_2, arelx: 1},
|
280
|
+
{ruby: 2.7, rails: 4_2, arelx: 1},
|
281
|
+
{ruby: 2.5, rails: 6_1, arelx: 2},
|
282
|
+
{ruby: 2.5, rails: 6, arelx: 2},
|
283
|
+
{ruby: 2.5, rails: 5_2, arelx: 1},
|
284
|
+
{ruby: 2.5, rails: 4_2, arelx: 1},
|
285
|
+
# {ruby: jruby-9.2, rails: 6_1, arelx: 2},
|
286
|
+
# {ruby: jruby-9.2, rails: 6, arelx: 2},
|
287
|
+
{ruby: jruby-9.2, rails: 5_2, arelx: 1},
|
288
|
+
{ruby: jruby-9.2, rails: 4_2, arelx: 1},
|
289
|
+
# {ruby: jruby-9.3, rails: 6_1, arelx: 2},
|
290
|
+
# {ruby: jruby-9.3, rails: 6, arelx: 2},
|
291
|
+
{ruby: jruby-9.3, rails: 5_2, arelx: 1},
|
307
292
|
]
|
293
|
+
mssql: [2017, 2019]
|
308
294
|
steps:
|
309
295
|
- uses: actions/checkout@v2
|
310
296
|
- name: Set up Ruby
|
311
297
|
uses: ruby/setup-ruby@v1
|
312
298
|
with:
|
313
|
-
ruby-version: ${{ matrix.ruby }}
|
299
|
+
ruby-version: ${{ matrix.versions.ruby }}
|
314
300
|
- name: Install FreeTDS
|
315
301
|
run: |
|
316
302
|
sudo apt-get update -q
|
317
303
|
sudo apt-get install -y freetds-dev
|
318
|
-
- name: Install MSSQL ${{ matrix.
|
304
|
+
- name: Install MSSQL ${{ matrix.mssql }}
|
319
305
|
uses: potatoqualitee/mssqlsuite@v1.5.1
|
320
306
|
with:
|
321
|
-
version: ${{ matrix.
|
307
|
+
version: ${{ matrix.mssql }}
|
322
308
|
install: sqlengine, sqlclient, sqlpackage, localdb
|
323
309
|
sa-password: Password12!
|
324
310
|
- name: Update system-wide gems
|
325
|
-
run: gem update --system
|
326
|
-
- name: Download gem from build job
|
327
|
-
uses: actions/download-artifact@v2
|
328
|
-
with:
|
329
|
-
name: ${{ matrix.ruby }}-${{ matrix.rails }}-gem
|
311
|
+
run: gem update --system --no-document
|
330
312
|
- name: Setup Gemfile
|
331
|
-
if: ${{ matrix.
|
313
|
+
if: ${{ matrix.versions.arelx == 2 }}
|
332
314
|
run: |
|
333
315
|
cp ./gemspecs/arel_extensions-v2.gemspec ./arel_extensions.gemspec
|
334
316
|
cp ./version_v2.rb lib/arel_extensions/version.rb
|
335
|
-
cp ./gemfiles/rails${{ matrix.rails }}.gemfile ./Gemfile
|
317
|
+
cp ./gemfiles/rails${{ matrix.versions.rails }}.gemfile ./Gemfile
|
336
318
|
- name: bundle install
|
337
319
|
run: |
|
338
|
-
bundle config set gemfile ./gemfiles/rails${{ matrix.rails }}.gemfile
|
320
|
+
bundle config set gemfile ./gemfiles/rails${{ matrix.versions.rails }}.gemfile
|
339
321
|
bundle install
|
340
|
-
- name: Run test mssql
|
322
|
+
- name: Run test mssql [mri]
|
323
|
+
if: ${{ !contains(matrix.versions.ruby, 'jruby') }}
|
341
324
|
run: bundle exec rake test:mssql
|
325
|
+
- name: Run test mssql [jruby]
|
326
|
+
if: ${{ contains(matrix.versions.ruby, 'jruby') }}
|
327
|
+
run: |
|
328
|
+
curl -LO https://github.com/microsoft/mssql-jdbc/releases/download/v8.4.1/mssql-jdbc-8.4.1.jre11.jar
|
329
|
+
CLASSPATH=".:mssql-jdbc-8.4.1.jre11.jar" bundle exec rake test:mssql
|
data/NEWS.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Release
|
2
|
+
|
3
|
+
## Bug Fixes
|
4
|
+
|
5
|
+
- This used to fail.
|
6
|
+
```
|
7
|
+
Arel.when(a).then(b).format('%Y-%m-%d')
|
8
|
+
```
|
9
|
+
|
10
|
+
## New Features
|
11
|
+
|
12
|
+
- `o.present`, a synonym for `o.not_blank`
|
13
|
+
- `o.coalesce_blank(a, b, c)`
|
14
|
+
- `o.if_present`, if the value is `null` or blank, then it returns `null`,
|
15
|
+
otherwise, it returns the value. Inspired by rails' `presence`.
|