Skip to content

Commit

Permalink
ActiveRecord 7.2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
wollistik committed Sep 2, 2024
1 parent 583ed2b commit c0c6fb4
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 68 deletions.
30 changes: 5 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
gemfile: [ar_52, ar_60, ar_61, ar_70, ar_next]
exclude:
- ruby-version: '3.2'
gemfile: ar_52
- ruby-version: '3.2'
gemfile: ar_60
- ruby-version: '3.2'
gemfile: ar_61
- ruby-version: '3.1'
gemfile: ar_52
- ruby-version: '3.1'
gemfile: ar_60
- ruby-version: '3.1'
gemfile: ar_61
- ruby-version: '3.0'
gemfile: ar_52
- ruby-version: '2.6'
gemfile: ar_next
- ruby-version: '2.6'
gemfile: ar_70
- ruby-version: '2.5'
gemfile: ar_next
- ruby-version: '2.5'
gemfile: ar_70
ruby-version: ['3.1', '3.2', '3.3']
gemfile: [ar_70, ar_71, ar_72, ar_next]
# exclude:
# - ruby-version: '3.2'
# gemfile: ar_60
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
uses: ruby/setup-ruby@v1
# uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
with:
ruby-version: 2.7
ruby-version: 3.1
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run rubocop
run: bundle exec rubocop
4 changes: 2 additions & 2 deletions .github/workflows/rubygem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
contents: read

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.1
- run: bundle install
- name: Publish to RubyGems
env:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require:
inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 3.1
NewCops: enable
SuggestExtensions: false

Expand Down
23 changes: 9 additions & 14 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
# frozen_string_literal: true

appraise 'ar-52' do
gem 'activerecord', '~> 5.2.0'
gem 'activesupport', '~> 5.2.0'
end

appraise 'ar-60' do
gem 'activerecord', '~> 6.0.0'
gem 'activesupport', '~> 6.0.0'
appraise 'ar-70' do
gem 'activerecord', '~> 7.0'
gem 'activesupport', '~> 7.0'
end

appraise 'ar-61' do
gem 'activerecord', '~> 6.1.0'
gem 'activesupport', '~> 6.1.0'
appraise 'ar-71' do
gem 'activerecord', '~> 7.1'
gem 'activesupport', '~> 7.1'
end

appraise 'ar-70' do
gem 'activerecord', '~> 7.0'
gem 'activesupport', '~> 7.0'
appraise 'ar-72' do
gem 'activerecord', '~> 7.2'
gem 'activesupport', '~> 7.2'
end

appraise 'ar-next' do
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### Version 4.0.0
- ADD: Support for Rails 7.2
- BREAKING: Dropped support for Rails < 7
- BREAKING: Dropped support old Rubies < 3.1

### Version 3.5.0
- Added :dependent option for setting explicit deletion behaviour (issue #31)
- Added automatic cycle detection when supported (currently only PostgresSQL 14+) (issue #22)
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,16 @@ Luckily, there is already a SQL standard that makes it very easy to retrieve dat

## Supported environments
ActsAsRecursiveTree currently supports following ActiveRecord versions and is tested for compatibility:
* ActiveRecord 5.2.x
* ActiveRecord 6.0.x
* ActiveRecord 6.1.x
* ActiveRecord 7.0.x
* ActiveRecord 7.1.x
* ActiveRecord 7.2.x
* ActiveRecord NEXT (from git)

## Supported Rubies
ActsAsRecursiveTree is tested with following rubies:
* MRuby 2.5
* MRuby 2.6
* MRuby 2.7
* MRuby 3.0
* MRuby 3.1
* MRuby 3.2
* MRuby 3.3

Other Ruby implementations are not tested, but should also work.

Expand Down
6 changes: 3 additions & 3 deletions acts_as_recursive_tree.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Gem::Specification.new do |spec|
'bug_tracker_uri' => 'https://github.com/1and1/acts_as_recursive_tree/issues',
'changelog_uri' => 'https://github.com/1and1/acts_as_recursive_tree/blob/main/CHANGELOG.md'
}
spec.required_ruby_version = '>= 2.5.0'
spec.required_ruby_version = '>= 3.1.0'
spec.files = `git ls-files -z`.split("\x0")
spec.test_files = spec.files.grep(%r{^spec/})
spec.require_paths = ['lib']

spec.add_runtime_dependency 'activerecord', '>= 5.2.0', '< 8'
spec.add_runtime_dependency 'activesupport', '>= 5.2.0', '< 8'
spec.add_runtime_dependency 'activerecord', '>= 7.0.0', '< 8'
spec.add_runtime_dependency 'activesupport', '>= 7.0.0', '< 8'
spec.add_runtime_dependency 'zeitwerk', '>= 2.4'

spec.add_development_dependency 'appraisal', '~> 2.4'
Expand Down
8 changes: 0 additions & 8 deletions gemfiles/ar_61.gemfile

This file was deleted.

4 changes: 2 additions & 2 deletions gemfiles/ar_52.gemfile → gemfiles/ar_71.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "activerecord", "~> 5.2.0"
gem "activesupport", "~> 5.2.0"
gem "activerecord", "~> 7.1"
gem "activesupport", "~> 7.1"

gemspec path: "../"
4 changes: 2 additions & 2 deletions gemfiles/ar_60.gemfile → gemfiles/ar_72.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "activerecord", "~> 6.0.0"
gem "activesupport", "~> 6.0.0"
gem "activerecord", "~> 7.2"
gem "activesupport", "~> 7.2"

gemspec path: "../"
2 changes: 1 addition & 1 deletion lib/acts_as_recursive_tree/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ActsAsRecursiveTree
VERSION = '3.5.0'
VERSION = '4.0.0'
end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[File.join(__dir__, 'support/**/*.rb')].sort.each { |f| require f }
Dir[File.join(__dir__, 'support/**/*.rb')].each { |f| require f }

# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
Expand Down

0 comments on commit c0c6fb4

Please sign in to comment.