Skip to content

fix: restore proper deprecation for database_less configuration #459

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
Jul 24, 2025

Conversation

seuros
Copy link
Member

@seuros seuros commented Jul 24, 2025

Summary

Restores proper deprecation for the database_less configuration option that was removed in v9.1.0 without deprecation, causing deployment failures for users who had this configuration in their production setup.

Changes Made

  • Created minimal Configuration class to handle the deprecated option with proper warnings
  • Updated ClosureTree.configure to show specific deprecation messages
  • Made the option a no-op (always returns false) since it's no longer needed
  • Improved HasClosureTree include order dependencies with AssociationSetup concern
  • Updated conditional acts_as_tree alias to prevent conflicts with other gems
  • Fixed README code examples formatting

Breaking Change Fix

This addresses the breaking change introduced in v9.1.0 where users with existing configuration would see deployment failures. Now they get proper deprecation warnings:

DEPRECATION WARNING: ClosureTree.configure { |config| config.database_less = true } is deprecated and will be removed in v10.0.0. The database_less option is no longer needed for modern deployment practices. Remove this configuration from your initializer.

The option will be completely removed in v10.0.0.

The database_less configuration option was removed in v9.1.0 without proper
deprecation, causing deployments to fail when upgrading if they had this
configuration in their production.rb or initializers.

This change restores backward compatibility by:

- Adding a minimal Configuration class that captures the deprecated database_less option
- Showing specific deprecation warnings when database_less is used
- Making the option a no-op (always returns false) since it's no longer needed
- Providing clear migration guidance for users to remove their configuration

The deprecation timeline indicates removal in v10.0.0, giving users time to
migrate away from this obsolete configuration without breaking deployments.

Also includes improvements to HasClosureTree include order dependency and
README formatting fixes to use inline return value comments.

Fixes the missing deprecation that was introduced when migrating to Zeitwerk.
@seuros seuros merged commit de8b402 into master Jul 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant