Skip to content

feat: last version before major version bump, with_advisory_lock will… #448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ on:
pull_request:
branches:
- master
concurrency:
group: ci-${{ github.head_ref }}
cancel-in-progress: true


jobs:
rspec:
Expand Down Expand Up @@ -41,26 +39,15 @@ jobs:
matrix:
ruby:
- '3.3'
- '3.2'
- '3.1'
- '3.0'
rails:
- activerecord_8.0
- activerecord_7.2
- activerecord_7.1
- activerecord_7.0
- activerecord_6.1
- activerecord_edge
adapter:
- 'sqlite3:///:memory:'
- mysql2://root:root@0/closure_tree_test
- postgres://closure_tree:closure_tree@0/closure_tree_test
exclude:
- ruby: '3.0'
rails: activerecord_edge
- ruby: '3.1'
rails: activerecord_edge
- ruby: '3.0'
rails: activerecord_7.2

steps:
- name: Checkout
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci_jruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ jobs:
fail-fast: false
matrix:
rails:
- activerecord_7.0
- activerecord_6.1
- activerecord_7.1
adapter:
- 'sqlite3:///:memory:'
- mysql2://root:root@0/closure_tree_test
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci_truffleruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ jobs:
ruby:
- truffleruby
rails:
- activerecord_7.0
- activerecord_6.1
- activerecord_7.1
adapter:
- 'sqlite3:///:memory:'
- mysql2://root:root@0/closure_tree_test
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 3.2.2
ruby 3.4.4
31 changes: 8 additions & 23 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
# frozen_string_literal: true

appraise 'activerecord-6.1' do
gem 'activerecord', '~> 6.1.0'
platforms :ruby do
gem 'mysql2'
gem 'pg'
gem 'sqlite3', '< 2.0'
end

platforms :jruby do
gem 'activerecord-jdbcmysql-adapter'
gem 'activerecord-jdbcpostgresql-adapter'
gem 'activerecord-jdbcsqlite3-adapter'
end
end

appraise 'activerecord-7.0' do
gem 'activerecord', '~> 7.0.0'
platforms :ruby do
appraise 'activerecord-7.1' do
gem 'activerecord', '~> 7.1.0'
platforms :ruby, :truffleruby do
gem 'mysql2'
gem 'pg'
gem 'sqlite3', '< 2.0'
Expand All @@ -30,12 +15,12 @@ appraise 'activerecord-7.0' do
end
end

appraise 'activerecord-7.1' do
gem 'activerecord', '~> 7.1.0'
appraise 'activerecord-7.2' do
gem 'activerecord', '~> 7.2.0'
platforms :ruby do
gem 'mysql2'
gem 'pg'
gem 'sqlite3', '< 2.0'
gem 'sqlite3'
end

platforms :jruby do
Expand All @@ -45,8 +30,8 @@ appraise 'activerecord-7.1' do
end
end

appraise 'activerecord-7.2' do
gem 'activerecord', '~> 7.2.0'
appraise 'activerecord-8.0' do
gem 'activerecord', '~> 8.0.0'
platforms :ruby do
gem 'mysql2'
gem 'pg'
Expand Down
6 changes: 0 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@ source 'https://rubygems.org'

gemspec

platform :mri do
group :development do
gem 'bump', '~> 0.10.0'
gem 'github_changelog_generator', '~> 1.16'
end
end
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ closure_tree has some great features:
* 2 SQL INSERTs on node creation
* 3 SQL INSERT/UPDATEs on node reparenting
* __Support for [concurrency](#concurrency)__ (using [with_advisory_lock](https://github.com/ClosureTree/with_advisory_lock))
* __Tested against ActiveRecord 6.0+ with Ruby 2.7+__
* __Tested against ActiveRecord 7.1+ with Ruby 3.3+__
* Support for reparenting children (and all their descendants)
* Support for [single-table inheritance (STI)](#sti) within the hierarchy
* ```find_or_create_by_path``` for [building out heterogeneous hierarchies quickly and conveniently](#find_or_create_by_path)
Expand Down Expand Up @@ -52,7 +52,7 @@ for a description of different tree storage algorithms.

## Installation

Note that closure_tree only supports ActiveRecord 6.0 and later, and has test coverage for MySQL, PostgreSQL, and SQLite.
Note that closure_tree only supports ActiveRecord 7.1 and later, and has test coverage for MySQL, PostgreSQL, and SQLite.

1. Add `gem 'closure_tree'` to your Gemfile

Expand Down Expand Up @@ -662,8 +662,8 @@ end

Closure tree is [tested under every valid combination](https://github.com/ClosureTree/closure_tree/blob/master/.github/workflows/ci.yml) of

* Ruby 2.7+
* ActiveRecord 6.0+
* Ruby 3.3+
* ActiveRecord 7.1+
* PostgreSQL, MySQL, and SQLite. Concurrency tests are only run with MySQL and PostgreSQL.

```shell
Expand Down
10 changes: 0 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,4 @@ Rake::TestTask.new do |t|
t.verbose = true
end

if RUBY_ENGINE == 'ruby'
require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.user = 'ClosureTree'
config.project = 'closure_tree'
config.issues = false
config.future_release = '5.2.0'
config.since_tag = 'v7.4.0'
end
end
task default: 'spec:all'
6 changes: 3 additions & 3 deletions closure_tree.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Gem::Specification.new do |gem|
end

gem.test_files = gem.files.grep(%r{^spec/})
gem.required_ruby_version = '>= 3.0.0'
gem.required_ruby_version = '>= 3.3.0'

gem.add_runtime_dependency 'activerecord', '>= 6.1.0'
gem.add_runtime_dependency 'with_advisory_lock', '>= 5.0.0'
gem.add_runtime_dependency 'activerecord', '>= 7.1.0'
gem.add_runtime_dependency 'with_advisory_lock', '>= 5.0.0', '< 6.0.0'

gem.add_development_dependency 'appraisal'
gem.add_development_dependency 'database_cleaner'
Expand Down
26 changes: 0 additions & 26 deletions gemfiles/activerecord_7.0.gemfile

This file was deleted.

9 changes: 1 addition & 8 deletions gemfiles/activerecord_7.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@ source "https://rubygems.org"

gem "activerecord", "~> 7.1.0"

platforms :mri do
group :development do
gem "bump", "~> 0.10.0"
gem "github_changelog_generator", "~> 1.16"
end
end

platforms :ruby do
platforms :ruby, :truffleruby do
gem "mysql2"
gem "pg"
gem "sqlite3", "< 2.0"
Expand Down
7 changes: 0 additions & 7 deletions gemfiles/activerecord_7.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ source "https://rubygems.org"

gem "activerecord", "~> 7.2.0"

platforms :mri do
group :development do
gem "bump", "~> 0.10.0"
gem "github_changelog_generator", "~> 1.16"
end
end

platforms :ruby do
gem "mysql2"
gem "pg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@

source "https://rubygems.org"

gem "activerecord", "~> 6.1.0"

platforms :mri do
group :development do
gem "bump", "~> 0.10.0"
gem "github_changelog_generator", "~> 1.16"
end
end
gem "activerecord", "~> 8.0.0"

platforms :ruby do
gem "mysql2"
gem "pg"
gem "sqlite3", "< 2.0"
gem "sqlite3"
end

platforms :jruby do
Expand Down
7 changes: 0 additions & 7 deletions gemfiles/activerecord_edge.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ source "https://rubygems.org"

gem "activerecord", github: "rails/rails"

platforms :mri do
group :development do
gem "bump", "~> 0.10.0"
gem "github_changelog_generator", "~> 1.16"
end
end

platforms :ruby do
gem "mysql2"
gem "pg"
Expand Down
Loading