activerecord-cte 0.1.4 → 0.1.5

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: 9c5fd306f910ad7183f278dfbbf91363e7825a823f31fbb798693a8a529db23c
4
- data.tar.gz: aa0dcc304d3469394b2e0eb6496ddfac22632df5febc0d43f71302fbbdbfe3d6
3
+ metadata.gz: fa6017d175139cbb92a4428130dc7ca14c10018a9a32d9c3dba0a6b68e41e348
4
+ data.tar.gz: 139a0430c0f9732e36de816475d9c3d8fc12bd326ef1349401549193112652f2
5
5
  SHA512:
6
- metadata.gz: c13b4cb8fe44d0380856fbac382f27f9881d03dcb6d9c6fb21d0cb1c5d2704d09d0e51432b165816f939d1ce46957d877ffc84bdeda837d20604d78065ccfa4b
7
- data.tar.gz: a64ff3e533e71d04437f706197266782fd5ab3ec8fe4df047814cd2ffda5dc9bea24040bb93ddfb4b794c068e57df4d5f710d8b941a7cbe8384c57cc039c2db8
6
+ metadata.gz: '095fb61691550d6b95064d6d64e821759fd57d820f065eef9785284329bc8edceb69f8a29e244a25258851acc540bbc99446823f2309f4a1f2e6d8454cde779d'
7
+ data.tar.gz: 308d0fe1766731ff4977783249d12a0ac9f845321124b4db793ef5ed13c00585af36afa4958e7ee5fe57d7175ac5d481f1a822fe0151552a9a9856050712ad10
@@ -1,5 +1,5 @@
1
1
  name: Rubocop
2
- on: [push]
2
+ on: [pull_request]
3
3
  jobs:
4
4
  Rubocop:
5
5
  runs-on: ubuntu-latest
@@ -1,12 +1,12 @@
1
1
  name: MySql
2
- on: [push]
2
+ on: [pull_request]
3
3
  jobs:
4
4
  Test-With-Mysql:
5
5
  runs-on: ubuntu-latest
6
6
  strategy:
7
7
  fail-fast: false
8
8
  matrix:
9
- active_record: [6.0.4, 5.2.6]
9
+ active_record: [6.1.4, 6.0.4, 5.2.6]
10
10
  env:
11
11
  ACTIVE_RECORD_VERSION: ${{ matrix.active_record }}
12
12
  DATABASE_ADAPTER: mysql
@@ -1,5 +1,5 @@
1
1
  name: PostgreSQL
2
- on: [push]
2
+ on: [pull_request]
3
3
  jobs:
4
4
  Test-With-PostgreSQL:
5
5
  runs-on: ubuntu-latest
@@ -7,7 +7,7 @@ jobs:
7
7
  strategy:
8
8
  fail-fast: false
9
9
  matrix:
10
- active_record: [6.0.4, 5.2.6]
10
+ active_record: [6.1.4, 6.0.4, 5.2.6]
11
11
  env:
12
12
  ACTIVE_RECORD_VERSION: ${{ matrix.active_record }}
13
13
  DATABASE_ADAPTER: postgresql
@@ -1,12 +1,12 @@
1
1
  name: SQLite
2
- on: [push]
2
+ on: [pull_request]
3
3
  jobs:
4
4
  Test-With-SQLite:
5
5
  runs-on: ubuntu-latest
6
6
  strategy:
7
7
  fail-fast: false
8
8
  matrix:
9
- active_record: [6.0.4, 5.2.6]
9
+ active_record: [6.1.4, 6.0.4, 5.2.6]
10
10
  env:
11
11
  ACTIVE_RECORD_VERSION: ${{ matrix.active_record }}
12
12
  DATABASE_ADAPTER: sqlite3
data/bin/test CHANGED
@@ -2,39 +2,31 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "English"
5
+ require "yaml"
5
6
 
6
- ADAPTERS = %w[
7
- mysql
8
- postgresql
9
- sqlite3
10
- ].freeze
7
+ active_record_versions = []
8
+ database_adapters = []
11
9
 
12
- ACTIVE_RECORD_VERSIONS = %w[
13
- 6.0.4
14
- 5.2.6
15
- ].freeze
10
+ # Extract ActiveRecord versions and database adapters from CI workflows
11
+ Dir[".github/workflows/test-**.yml"].each do |path|
12
+ yml = YAML.load_file(path)
13
+ job = yml["jobs"].values.first
14
+ active_record_versions << job["strategy"]["matrix"]["active_record"]
15
+ database_adapters << job["env"]["DATABASE_ADAPTER"]
16
+ end
16
17
 
17
18
  class Matrix
18
- def self.run
19
- new.run
20
- end
21
-
22
- def initialize
19
+ def initialize(active_record_versions, database_adapters)
20
+ @active_record_versions = active_record_versions
21
+ @database_adapters = database_adapters
23
22
  @exit_status_code = 0
24
23
  end
25
24
 
26
- def run # rubocop:disable Metrics/MethodLength
25
+ def run
27
26
  original_ar_version = `bundle show activerecord`.split("-").last.strip
28
- ACTIVE_RECORD_VERSIONS.each do |ar_version|
29
- puts "----> Switching ActiveRecord to version #{ar_version}"
30
- cmd("ACTIVE_RECORD_VERSION=#{ar_version} bundle update activerecord")
31
-
32
- ADAPTERS.each do |adapter|
33
- puts "----> Running tests with ActiveRecord #{ar_version} and #{adapter} adapter"
34
- cmd("DATABASE_ADAPTER=#{adapter} ACTIVE_RECORD_VERSION=#{ar_version} bundle exec rake test")
35
- end
27
+ @active_record_versions.each do |ar_version|
28
+ run_with_active_record_version(ar_version)
36
29
  end
37
-
38
30
  puts "----> Reverting back to original ActiveRecord version (#{original_ar_version})"
39
31
  cmd("ACTIVE_RECORD_VERSION=#{original_ar_version} bundle update activerecord")
40
32
 
@@ -47,6 +39,16 @@ class Matrix
47
39
  system(cmd)
48
40
  @exit_status_code = $CHILD_STATUS.exitstatus unless $CHILD_STATUS.success?
49
41
  end
42
+
43
+ def run_with_active_record_version(ar_version)
44
+ puts "----> Switching ActiveRecord to version #{ar_version}"
45
+ cmd("ACTIVE_RECORD_VERSION=#{ar_version} bundle update activerecord")
46
+
47
+ @database_adapters.each do |adapter|
48
+ puts "----> Running tests with ActiveRecord #{ar_version} and #{adapter} adapter"
49
+ cmd("DATABASE_ADAPTER=#{adapter} ACTIVE_RECORD_VERSION=#{ar_version} bundle exec rake test")
50
+ end
51
+ end
50
52
  end
51
53
 
52
- Matrix.run
54
+ Matrix.new(active_record_versions.flatten.uniq, database_adapters.uniq).run
@@ -46,8 +46,8 @@ module ActiveRecord
46
46
 
47
47
  private
48
48
 
49
- def build_arel(aliases)
50
- arel = super(aliases)
49
+ def build_arel(*args, **kwargs)
50
+ arel = super
51
51
  build_with(arel) if @values[:with]
52
52
  arel
53
53
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Activerecord
4
4
  module Cte
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-cte
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlado Cingel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-27 00:00:00.000000000 Z
11
+ date: 2021-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord