Skip to content

feat: use new with_advisory_lock #450

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 28, 2025
Merged

feat: use new with_advisory_lock #450

merged 1 commit into from
May 28, 2025

Conversation

seuros
Copy link
Member

@seuros seuros commented May 28, 2025

- Removed deprecated Rails 3/4 features
- Removed use_attr_accessible? and include_forbidden_attributes_protection? methods.
- Removed attr_accessible declarations.
- Fixed SQLite compatibility.
- Auto-disabled advisory locks for SQLite (since it doesn't support them) 
- SQLite will be supported if it behave, if causing maintenance burden, we  will remove.

This commit is transitional , further refactoring are required.

@seuros seuros requested review from Copilot and mceachen May 28, 2025 20:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR transitions the project to use the new with_advisory_lock gem, removes deprecated Rails 3/4 features, and adds explicit SQLite compatibility handling.

  • Removes attr_accessible support and related flags.
  • Auto-disables advisory locks for SQLite and adds DB recreation logic for PostgreSQL/MySQL in tests.
  • Bumps with_advisory_lock dependency in gemfiles and gemspec.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/test_helper.rb Rework test DB reset to handle PostgreSQL/MySQL, skip for SQLite
test/support/tag_examples.rb Remove obsolete use_attr_accessible?-based example
test/closure_tree/matcher_test.rb Skip advisory lock tests on SQLite
lib/closure_tree/support_flags.rb Remove deprecated mass-assignment methods
lib/closure_tree/support.rb Add default advisory lock option based on adapter
lib/closure_tree/numeric_order_support.rb Simplify adapter detection for numeric order support
gemfiles/*.gemfile Add with_advisory_lock dependency to all test appraisals
closure_tree.gemspec Update runtime dependency requirement for with_advisory_lock
Gemfile Add with_advisory_lock for development environment
Comments suppressed due to low confidence (2)

test/test_helper.rb:88

  • The variable connection_config may not be defined in this context. Consider using ActiveRecord::Base.connection_db_config.configuration_hash or ActiveRecord::Base.connection_config to obtain the current connection settings.
      if connection_config.is_a?(String)

lib/closure_tree/support.rb:23

  • The method connection is undefined here. You should call model_class.connection or ActiveRecord::Base.connection to access the adapter.
      default_with_advisory_lock = !connection.adapter_name.downcase.include?('sqlite')

@seuros seuros merged commit 1b07d5b into master May 28, 2025
6 of 18 checks passed
@seuros seuros deleted the multidb branch May 28, 2025 20:27
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