Skip to content

Commit

Permalink
Get CI passing on Rails main again (#482)
Browse files Browse the repository at this point in the history
Fixes:

- Require Ruby >= 3.1
- Require rspec-rails >= 6.0.2
- Call #inspect on Relation#explain to ensure we have a string
  • Loading branch information
botandrose authored Feb 28, 2024
1 parent 64006ba commit 70cdc5e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,16 @@ jobs:
- ruby: '3.0'
gemfile: rails_5_2

# Rails 7 requires Ruby 2.7 or higher
# Rails 8 requires Ruby 3.1 or higher
- ruby: '2.6'
gemfile: rails_main

- ruby: '2.7'
gemfile: rails_main

- ruby: '3.0'
gemfile: rails_main

- ruby: '2.6'
gemfile: rails_7_0

Expand Down Expand Up @@ -89,13 +95,19 @@ jobs:
- ruby: '3.0'
gemfile: rails_5_2

# Rails 7 requires Ruby 2.7 or higher
# Rails 8 requires Ruby 3.1 or higher
- ruby: '2.6'
gemfile: rails_main

- ruby: '2.7'
gemfile: rails_main

- ruby: '3.0'
gemfile: rails_main

- ruby: '2.6'
gemfile: rails_7_0

- ruby: '2.6'
gemfile: rails_7_1
env:
Expand Down Expand Up @@ -158,15 +170,21 @@ jobs:
- ruby: '3.0'
gemfile: rails_5_2

# Rails 7 requires Ruby 2.7 or higher
# Rails 8 requires Ruby 3.1 or higher
- ruby: '2.6'
gemfile: rails_7_0

gemfile: rails_main

- ruby: '2.7'
gemfile: rails_main

- ruby: '3.0'
gemfile: rails_main

- ruby: '2.6'
gemfile: rails_7_1
gemfile: rails_7_0

- ruby: '2.6'
gemfile: rails_main
gemfile: rails_7_1
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
BUNDLE_PATH_RELATIVE_TO_CWD: true
Expand Down
1 change: 1 addition & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ end

appraise "rails-main" do
gem "rails", github: "rails/rails", branch: "main"
gem "rspec-rails", "~> 6.0.2"
end
1 change: 1 addition & 0 deletions gemfiles/rails_main.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
source "https://rubygems.org"

gem "rails", github: "rails/rails", branch: "main"
gem "rspec-rails", "~> 6.0.2"

platforms :ruby do
gem "sqlite3"
Expand Down
4 changes: 2 additions & 2 deletions spec/awesome_nested_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1225,13 +1225,13 @@ def check_structure(entries, structure)
it "should sort by custom sort column" do
expect(OrderedCategory.acts_as_nested_set_options[:order_column]).to eq('name')
expect(OrderedCategory.order_column_name).to eq('name')
expect(OrderedCategory.first.children.explain).to include('ORDER BY name')
expect(OrderedCategory.first.children.explain.inspect).to include('ORDER BY name')
end

it "should sort by custom hash sort" do
expect(HashOrderedCategory.acts_as_nested_set_options[:order_column]).to eq({ :name => :desc })
expect(HashOrderedCategory.order_column_name).to eq({ :name => :desc })
expect(HashOrderedCategory.first.children.explain).to include(
expect(HashOrderedCategory.first.children.explain.inspect).to include(
"ORDER BY #{HashOrderedCategory.quoted_table_name}.#{HashOrderedCategory.connection.quote_column_name(:name)} DESC"
)
end
Expand Down

0 comments on commit 70cdc5e

Please sign in to comment.