arel-extensions 6.1.0 → 7.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 576ed17dde483e58188e1f7124bf77f4a479486b31166af59b1779ce955cf022
4
- data.tar.gz: a5253c48854f0b13604867cb36877b03ac6a3166724d11d25fa968b2f7654757
3
+ metadata.gz: 25d31b82bda12cbddc9ff7110b040e74d827a97d430259c7c4be9c1c50071f38
4
+ data.tar.gz: 727762032b716e7c8c4cde9d9867702e717a7bad8e772aca649cd200fcd292a1
5
5
  SHA512:
6
- metadata.gz: 3ea0ba57874c4abfb39fb448c60d8fe6a3829ba4a59d220ba348ad30fb04bea583928c1df4735a71c97a3d1a46d79ad990449cd82d66df5d73a5d947ad169952
7
- data.tar.gz: 1d970867a870fbb319bd4ccbb5bc9cd110fe3b889b539da3069abc72a68e899b09f02d3f650d2a3a30b6d5defd65f8fd1c7fcf7ee3208ddc9e8eaa8524eb18c9
6
+ metadata.gz: fa40b55d8bd479d4947594d2d56e9a0ff6c8cbb045d2dfd7ab8b64ef987bfada7658a5f1bad2432e3db889d48cfc89f628cb5b06109960148478f59c260ce147
7
+ data.tar.gz: aafe42cbb6f0e1739457c19f3c9de60d76e5879b973dd7125a23bd8dc1aa9beb0aeb2a734fd5bef30f8200f50951a6948f46b17a847e974d89f3b95be8a86ef7
@@ -0,0 +1,166 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ sunstone:
11
+ name: Arel::Extensions Test
12
+ runs-on: ubuntu-22.04
13
+
14
+ steps:
15
+ - name: Install Postgresql
16
+ run: |
17
+ sudo pg_dropcluster 13 main && echo 'okay'
18
+ sudo pg_dropcluster 14 main && echo 'okay'
19
+ sudo rm -rf /etc/postgresql-common
20
+ sudo apt-get -y --purge remove $(sudo apt list --installed | grep postgresql | awk '{print $1}')
21
+ sudo apt-get install curl ca-certificates gnupg
22
+ curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
23
+ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
24
+ sudo apt-get update
25
+ sudo apt-get -y install postgresql-15
26
+ sudo systemctl start postgresql@15-main.service
27
+ sudo systemctl status postgresql@15-main.service
28
+ sudo pg_lsclusters
29
+ sudo -u postgres createuser runner --superuser
30
+
31
+ - uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: 3.1
34
+
35
+ - uses: actions/checkout@v2
36
+
37
+ - run: bundle
38
+
39
+ - run: bundle exec rake test
40
+
41
+ ar-postgresql:
42
+ name: ActiveRecord PostgresQL Test
43
+ runs-on: ubuntu-22.04
44
+
45
+ strategy:
46
+ matrix:
47
+ rails:
48
+ - v7.0.4
49
+
50
+ steps:
51
+ - name: Install Postgresql
52
+ run: |
53
+ sudo pg_dropcluster 13 main && echo 'okay'
54
+ sudo pg_dropcluster 14 main && echo 'okay'
55
+ sudo rm -rf /etc/postgresql-common
56
+ sudo apt-get -y --purge remove $(sudo apt list --installed | grep postgresql | awk '{print $1}')
57
+ sudo apt-get install curl ca-certificates gnupg
58
+ curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
59
+ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
60
+ sudo apt-get update
61
+ sudo apt-get -y install postgresql-15
62
+ sudo systemctl start postgresql@15-main.service
63
+ sudo systemctl status postgresql@15-main.service
64
+ sudo pg_lsclusters
65
+ sudo -u postgres createuser runner --superuser
66
+
67
+ - uses: ruby/setup-ruby@v1
68
+ with:
69
+ ruby-version: 3.1
70
+
71
+ - uses: actions/checkout@v2
72
+
73
+ - name: Download Rails
74
+ run: |
75
+ git clone --branch ${{ matrix.rails }} https://github.com/rails/rails.git ~/rails
76
+ pushd ~/rails
77
+ cat /home/runner/work/_temp/*.sh
78
+ sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/rails/activerecord/Rakefile
79
+ sed -i "s/t.warning = true/t.warning = false/g" ~/rails/activerecord/Rakefile
80
+ sed -i "/require 'support\/connection'/a \$LOAD_PATH.unshift\(File.expand_path\(ENV['GITHUB_WORKSPACE']\)\)\nrequire 'arel/extensions'" ~/rails/activerecord/test/cases/helper.rb
81
+ rm ~/rails/Gemfile.lock
82
+ sed -i "/# Active Record./a gem 'arel-extensions', require: 'arel/extensions', path: File.expand_path\(ENV['GITHUB_WORKSPACE']\)" ~/rails/Gemfile
83
+ cat ~/rails/Gemfile
84
+ bundle update --jobs=3 --retry=3
85
+
86
+ - run: |
87
+ pushd ~/rails/activerecord
88
+ bundle exec rake db:postgresql:rebuild postgresql:test
89
+ bundle exec rake db:postgresql:rebuild postgresql:isolated_test
90
+
91
+ ar-sqlite:
92
+ name: ActiveRecord SQLite Test
93
+ runs-on: ubuntu-22.04
94
+
95
+ strategy:
96
+ matrix:
97
+ rails:
98
+ - v7.0.4
99
+
100
+ steps:
101
+ - uses: ruby/setup-ruby@v1
102
+ with:
103
+ ruby-version: 3.0
104
+
105
+ - uses: actions/checkout@v2
106
+
107
+ - name: Download Rails
108
+ run: |
109
+ git clone --branch ${{ matrix.rails }} https://github.com/rails/rails.git ~/rails
110
+ pushd ~/rails
111
+ cat /home/runner/work/_temp/*.sh
112
+ sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/rails/activerecord/Rakefile
113
+ sed -i "s/t.warning = true/t.warning = false/g" ~/rails/activerecord/Rakefile
114
+ sed -i "/require 'support\/connection'/a \$LOAD_PATH.unshift\(File.expand_path\(ENV['GITHUB_WORKSPACE']\)\)\nrequire 'arel/extensions'" ~/rails/activerecord/test/cases/helper.rb
115
+ rm ~/rails/Gemfile.lock
116
+ sed -i "/# Active Record./a gem 'arel-extensions', require: 'arel/extensions', path: File.expand_path\(ENV['GITHUB_WORKSPACE']\)" ~/rails/Gemfile
117
+ cat ~/rails/Gemfile
118
+ bundle update --jobs=3 --retry=3
119
+
120
+ - run: |
121
+ pushd ~/rails/activerecord
122
+ bundle exec rake sqlite3:test
123
+ rm test/db/*.sqlite3 test/fixtures/*.sqlite3
124
+ bundle exec rake sqlite3:isolated_test
125
+ rm test/db/*.sqlite3 test/fixtures/*.sqlite3
126
+ bundle exec rake sqlite3_mem:test
127
+
128
+ ar-mysql:
129
+ name: ActiveRecord MySQL Test
130
+ runs-on: ubuntu-22.04
131
+
132
+ strategy:
133
+ matrix:
134
+ rails:
135
+ - v7.0.4
136
+
137
+ steps:
138
+ - name: Install MySQL
139
+ run: |
140
+ sudo /etc/init.d/mysql start
141
+ mysql -uroot -proot -e "CREATE USER 'rails'@'%';"
142
+ mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'rails'@'%' WITH GRANT OPTION;"
143
+
144
+ - uses: ruby/setup-ruby@v1
145
+ with:
146
+ ruby-version: 3.0
147
+
148
+ - uses: actions/checkout@v2
149
+
150
+ - name: Download Rails
151
+ run: |
152
+ git clone --branch ${{ matrix.rails }} https://github.com/rails/rails.git ~/rails
153
+ pushd ~/rails
154
+ cat /home/runner/work/_temp/*.sh
155
+ sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/rails/activerecord/Rakefile
156
+ sed -i "s/t.warning = true/t.warning = false/g" ~/rails/activerecord/Rakefile
157
+ sed -i "/require 'support\/connection'/a \$LOAD_PATH.unshift\(File.expand_path\(ENV['GITHUB_WORKSPACE']\)\)\nrequire 'arel/extensions'" ~/rails/activerecord/test/cases/helper.rb
158
+ rm ~/rails/Gemfile.lock
159
+ sed -i "/# Active Record./a gem 'arel-extensions', require: 'arel/extensions', path: File.expand_path\(ENV['GITHUB_WORKSPACE']\)" ~/rails/Gemfile
160
+ cat ~/rails/Gemfile
161
+ bundle update --jobs=3 --retry=3
162
+
163
+ - run: |
164
+ pushd ~/rails/activerecord
165
+ bundle exec rake db:mysql:rebuild mysql2:test
166
+ bundle exec rake db:mysql:rebuild mysql2:isolated_test
@@ -13,14 +13,14 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
14
  gem.require_paths = ["lib"]
15
15
 
16
- gem.add_dependency 'activerecord', '>= 6.1.0'
16
+ gem.add_dependency 'activerecord', '>= 7.0.0'
17
17
 
18
18
  gem.add_development_dependency "bundler"
19
19
  gem.add_development_dependency "byebug"
20
20
  gem.add_development_dependency "rake"
21
21
  gem.add_development_dependency 'minitest'
22
22
  gem.add_development_dependency 'minitest-reporters'
23
- gem.add_development_dependency "sunstone", '>= 6.1.0'
23
+ gem.add_development_dependency "sunstone", '>= 7.0.0'
24
24
  gem.add_development_dependency "webmock"
25
25
  gem.add_development_dependency 'pg'
26
26
  gem.add_development_dependency 'rgeo'
@@ -9,6 +9,18 @@ module Arel
9
9
  @nulls = nulls
10
10
  end
11
11
 
12
+ def reverse
13
+ reverse_nulls = if nulls == :nulls_first
14
+ :nulls_last
15
+ elsif nulls
16
+ :nulls_first
17
+ else
18
+ nil
19
+ end
20
+
21
+ Descending.new(expr, reverse_nulls)
22
+ end
23
+
12
24
  end
13
25
  end
14
26
  end
@@ -9,6 +9,18 @@ module Arel
9
9
  @nulls = nulls
10
10
  end
11
11
 
12
+ def reverse
13
+ reverse_nulls = if nulls == :nulls_first
14
+ :nulls_last
15
+ elsif nulls
16
+ :nulls_first
17
+ else
18
+ nil
19
+ end
20
+
21
+ Ascending.new(expr, reverse_nulls)
22
+ end
23
+
12
24
  end
13
25
 
14
26
  end
@@ -24,7 +24,7 @@ module ActiveRecord::QueryMethods
24
24
  end
25
25
  alias uniq_on! distinct_on!
26
26
 
27
- def build_arel_with_distinct_on(aliases)
27
+ def build_arel_with_distinct_on(aliases = nil)
28
28
  arel = build_arel_without_distinct_on(aliases)
29
29
  arel.distinct_on(self.distinct_on_values) if !self.distinct_on_values.empty?
30
30
  arel
@@ -1,5 +1,5 @@
1
1
  module Arel
2
2
  module Extensions
3
- VERSION = '6.1.0'
3
+ VERSION = '7.0.1'
4
4
  end
5
5
  end
@@ -1,5 +1,6 @@
1
1
  require "arel"
2
- require File.expand_path('../nodes/hex_encoded_binary', __FILE__)
2
+ require File.expand_path('../nodes/binary_value', __FILE__)
3
+ require File.expand_path('../nodes/hex_encoded_binary_value', __FILE__)
3
4
 
4
5
  require File.expand_path('../nodes/within', __FILE__)
5
6
  require File.expand_path('../nodes/excludes', __FILE__)
@@ -0,0 +1,7 @@
1
+ module Arel
2
+ module Nodes
3
+ class BinaryValue < Arel::Nodes::Unary
4
+
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Arel
2
+ module Nodes
3
+ class HexEncodedBinaryValue < Arel::Nodes::Unary
4
+
5
+ end
6
+ end
7
+ end
@@ -139,11 +139,14 @@ module Arel
139
139
  collector << ')'
140
140
  collector
141
141
  end
142
-
143
- def visit_Arel_Nodes_HexEncodedBinary(o, collector)
144
- collector << "E'\\\\x"
145
- collector << o.expr
146
- collector << "'"
142
+
143
+ def visit_Arel_Nodes_BinaryValue(o, collector)
144
+ collector << quote(@connection.escape_bytea(o.expr))
145
+ collector
146
+ end
147
+
148
+ def visit_Arel_Nodes_HexEncodedBinaryValue(o, collector)
149
+ collector << quote("\\x" + o.expr)
147
150
  collector
148
151
  end
149
152
 
@@ -91,7 +91,7 @@ module Arel
91
91
 
92
92
  def visit_Arel_Nodes_Excludes o, collector
93
93
  key = visit(o.left, collector)
94
- value = { excludes: o.left.type_cast_for_database(o.right) }
94
+ value = { excludes: visit(o.right, collector) }
95
95
 
96
96
  if key.is_a?(Hash)
97
97
  add_to_bottom_of_hash(key, value)
@@ -102,7 +102,7 @@ module Arel
102
102
 
103
103
  def visit_Arel_Nodes_Overlaps o, collector
104
104
  key = visit(o.left, collector)
105
- value = { overlaps: o.left.type_cast_for_database(o.right) }
105
+ value = { overlaps: visit(o.right, collector) }
106
106
 
107
107
  if key.is_a?(Hash)
108
108
  add_to_bottom_of_hash_or_array(key, value)
@@ -114,13 +114,13 @@ module Arel
114
114
 
115
115
  def visit_Arel_Nodes_NotOverlaps o, collector
116
116
  key = visit(o.left, collector)
117
- value = { not_overlaps: o.left.type_cast_for_database(o.right) }
117
+ value = { not_overlaps: visit(o.right, collector) }
118
118
 
119
119
  if key.is_a?(Hash)
120
120
  add_to_bottom_of_hash_or_array(key, value)
121
121
  key
122
122
  else
123
- {key => value}
123
+ { key => value }
124
124
  end
125
125
  end
126
126
 
@@ -0,0 +1,23 @@
1
+ require 'test_helper'
2
+
3
+ class BinaryValueTest < ActiveSupport::TestCase
4
+
5
+ test 'binary value' do
6
+ query = Property.where( Arel::Nodes::BinaryValue.new("\x01\x01\x00\x00\x00\xC0K\x9B\x84\xD0.<@\b\x96\xA2n\x84%&@") )
7
+
8
+ assert_equal(<<~SQL.gsub(/( +|\n)/, ' ').strip, query.to_sql)
9
+ SELECT "properties".* FROM "properties"
10
+ WHERE '\\x0101000000c04b9b84d02e3c400896a26e84252640'
11
+ SQL
12
+ end
13
+
14
+ test 'hex encoded binary value' do
15
+ query = Property.where( Arel::Nodes::HexEncodedBinaryValue.new("0101000000c04b9b84d02e3c400896a26e84252640") )
16
+
17
+ assert_equal(<<~SQL.gsub(/( +|\n)/, ' ').strip, query.to_sql)
18
+ SELECT "properties".* FROM "properties"
19
+ WHERE '\\x0101000000c04b9b84d02e3c400896a26e84252640'
20
+ SQL
21
+ end
22
+
23
+ end
data/test/database.rb CHANGED
@@ -46,4 +46,4 @@ class SunstoneProperty < SunstoneRecord
46
46
  has_many :addresses, class_name: 'SunstoneAddress'
47
47
  end
48
48
 
49
- SunstoneRecord.establish_connection(adapter: 'sunstone', endpoint: 'http://example.com')
49
+ SunstoneRecord.establish_connection(adapter: 'sunstone', url: 'http://example.com')
data/test/order_test.rb CHANGED
@@ -44,4 +44,40 @@ class OrderTest < ActiveSupport::TestCase
44
44
  SQL
45
45
  end
46
46
 
47
+ # Test reversing orders
48
+ test '::order(column.asc.reverse)' do
49
+ assert_sql(<<~SQL, Property.order(Property.arel_table[:id].asc.reverse))
50
+ SELECT "properties".* FROM "properties" ORDER BY "properties"."id" DESC
51
+ SQL
52
+ end
53
+
54
+ test '::order(column.desc.reverse)' do
55
+ assert_sql(<<~SQL, Property.order(Property.arel_table[:id].desc.reverse))
56
+ SELECT "properties".* FROM "properties" ORDER BY "properties"."id" ASC
57
+ SQL
58
+ end
59
+
60
+ test '::order(column.asc(:nulls_first).reverse)' do
61
+ assert_sql(<<~SQL, Property.order(Property.arel_table[:id].asc(:nulls_first).reverse))
62
+ SELECT "properties".* FROM "properties" ORDER BY "properties"."id" DESC NULLS LAST
63
+ SQL
64
+ end
65
+
66
+ test '::order(column.asc(:nulls_last).reverse)' do
67
+ assert_sql(<<~SQL, Property.order(Property.arel_table[:id].asc(:nulls_last).reverse))
68
+ SELECT "properties".* FROM "properties" ORDER BY "properties"."id" DESC NULLS FIRST
69
+ SQL
70
+ end
71
+
72
+ test '::order(column.desc(:nulls_first).reverse)' do
73
+ assert_sql(<<~SQL, Property.order(Property.arel_table[:id].desc(:nulls_first).reverse))
74
+ SELECT "properties".* FROM "properties" ORDER BY "properties"."id" ASC NULLS LAST
75
+ SQL
76
+ end
77
+
78
+ test '::order(column.desc(:nulls_last).reverse)' do
79
+ assert_sql(<<~SQL, Property.order(Property.arel_table[:id].desc(:nulls_last).reverse))
80
+ SELECT "properties".* FROM "properties" ORDER BY "properties"."id" ASC NULLS FIRST
81
+ SQL
82
+ end
47
83
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arel-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 7.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-14 00:00:00.000000000 Z
11
+ date: 2023-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 6.1.0
19
+ version: 7.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 6.1.0
26
+ version: 7.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 6.1.0
103
+ version: 7.0.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 6.1.0
110
+ version: 7.0.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: webmock
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -157,8 +157,8 @@ executables: []
157
157
  extensions: []
158
158
  extra_rdoc_files: []
159
159
  files:
160
+ - ".github/workflows/ci.yml"
160
161
  - ".gitignore"
161
- - ".travis.yml"
162
162
  - Gemfile
163
163
  - LICENSE
164
164
  - README.md
@@ -175,12 +175,13 @@ files:
175
175
  - lib/arel/extensions/version.rb
176
176
  - lib/arel/gis_predications.rb
177
177
  - lib/arel/json_predications.rb
178
+ - lib/arel/nodes/binary_value.rb
178
179
  - lib/arel/nodes/contained_by.rb
179
180
  - lib/arel/nodes/excludes.rb
180
181
  - lib/arel/nodes/has_any_key.rb
181
182
  - lib/arel/nodes/has_key.rb
182
183
  - lib/arel/nodes/has_keys.rb
183
- - lib/arel/nodes/hex_encoded_binary.rb
184
+ - lib/arel/nodes/hex_encoded_binary_value.rb
184
185
  - lib/arel/nodes/random.rb
185
186
  - lib/arel/nodes/relation.rb
186
187
  - lib/arel/nodes/ts_match.rb
@@ -193,6 +194,7 @@ files:
193
194
  - lib/arel/visitors/postgresql_extensions.rb
194
195
  - lib/arel/visitors/sunstone_extensions.rb
195
196
  - lib/arel/visitors/to_sql_extensions.rb
197
+ - test/binary_value_test.rb
196
198
  - test/database.rb
197
199
  - test/order_test.rb
198
200
  - test/sunstone_test.rb
@@ -217,11 +219,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
219
  - !ruby/object:Gem::Version
218
220
  version: '0'
219
221
  requirements: []
220
- rubygems_version: 3.2.3
222
+ rubygems_version: 3.4.13
221
223
  signing_key:
222
224
  specification_version: 4
223
225
  summary: Adds support for missing SQL operators and functions to Arel
224
226
  test_files:
227
+ - test/binary_value_test.rb
225
228
  - test/database.rb
226
229
  - test/order_test.rb
227
230
  - test/sunstone_test.rb
data/.travis.yml DELETED
@@ -1,68 +0,0 @@
1
- dist: bionic
2
- language: ruby
3
- sudo: false
4
-
5
- cache:
6
- bundler: true
7
- directories:
8
- - /home/travis/.rvm/gems
9
-
10
- rvm:
11
- - 2.7
12
- - 3.0
13
-
14
- env:
15
- matrix:
16
- - RAILS_VERSION=v6.1.0 TASK='db:mysql:rebuild mysql2:test'
17
- - RAILS_VERSION=v6.1.0 TASK='db:mysql:rebuild mysql2:isolated_test'
18
- - RAILS_VERSION=v6.1.0 TASK='db:postgresql:rebuild postgresql:test'
19
- - RAILS_VERSION=v6.1.0 TASK='db:postgresql:rebuild postgresql:isolated_test'
20
- - RAILS_VERSION=v6.1.0 TASK='sqlite3:test'
21
- - RAILS_VERSION=v6.1.0 TASK='sqlite3:isolated_test'
22
- - RAILS_VERSION=v6.1.0 TASK='sqlite3_mem:test'
23
-
24
- services:
25
- - mysql
26
- addons:
27
- postgresql: "13"
28
- apt:
29
- packages:
30
- - postgresql-13
31
- - postgresql-client-13
32
-
33
- before_install:
34
- - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/13/main/postgresql.conf
35
- - sudo cp /etc/postgresql/{9.3,13}/main/pg_hba.conf
36
- - sudo pg_ctlcluster 13 main restart
37
- - unset BUNDLE_GEMFILE
38
- - gem update --system
39
- - gem update bundler
40
- - gem install bundler --version 1.17.3
41
- - mysql -e "create user rails@localhost;"
42
- - mysql -e "grant all privileges on activerecord_unittest.* to rails@localhost;"
43
- - mysql -e "grant all privileges on activerecord_unittest2.* to rails@localhost;"
44
- - mysql -e "grant all privileges on inexistent_activerecord_unittest.* to rails@localhost;"
45
- - mysql -e "create database activerecord_unittest default character set utf8mb4;"
46
- - mysql -e "create database activerecord_unittest2 default character set utf8mb4;"
47
-
48
- install:
49
- - git clone --branch $RAILS_VERSION https://github.com/rails/rails.git ~/build/rails
50
-
51
- before_script:
52
- - sed -i "s/t.warning = true/t.warning = false/g" Rakefile
53
- - pushd ~/build/rails
54
- - git status
55
- - sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/build/rails/activerecord/Rakefile
56
- - sed -i "s/t.warning = true/t.warning = false/g" ~/build/rails/activerecord/Rakefile
57
- - sed -i "/require 'support\/connection'/a \$LOAD_PATH.unshift\(File.expand_path\('~\/build\/malomalo\/arel-extensions\/lib'\)\)\nrequire 'arel/extensions'" ~/build/rails/activerecord/test/cases/helper.rb
58
- - "sed -i \"/group :db do/a gem 'arel-extensions', require: 'arel/extensions', path: File.expand_path\\('~\\/build\\/malomalo\\/arel-extensions'\\)\" ~/build/rails/Gemfile"
59
- - sed -i "/rb-inotify/d" ~/build/rails/Gemfile
60
- - cat ~/build/rails/Gemfile
61
- - rm ~/build/rails/Gemfile.lock
62
- - bundle update --jobs=3 --retry=3
63
- - popd
64
- - bundle install --jobs=3 --retry=3
65
-
66
- script:
67
- - bundle exec rake test
68
- - cd ~/build/rails/activerecord && bundle exec rake $TASK
@@ -1,7 +0,0 @@
1
- module Arel
2
- module Nodes
3
- class HexEncodedBinary < Arel::Nodes::Unary
4
-
5
- end
6
- end
7
- end