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