Skip to content
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

Naming conflict #83

Open
semaperepelitsa opened this issue Jan 3, 2024 · 4 comments
Open

Naming conflict #83

semaperepelitsa opened this issue Jan 3, 2024 · 4 comments

Comments

@semaperepelitsa
Copy link

The private method included in ActiveRecord has a very generic name and can easily conflict. Is it possible to give it a more specific name?

ActiveRecord::Base.send(:impl_class) #=> WithAdvisoryLock::PostgreSQL
@seuros
Copy link
Member

seuros commented Jan 21, 2024

Can you elaborate ?

@semaperepelitsa
Copy link
Author

At the moment, ActiveRecord::Base.send(:impl_class) is reserved for your library, but the method name doesn't contain "with advisory lock", so it could be easily used by other libraries or application code. Let's say, a pagination library decides that they need their own impl_class - now there is a conflict. A better name would be something like ActiveRecord::Base.send(:with_advisory_lock_impl_class).

@seuros
Copy link
Member

seuros commented Jan 21, 2024

Make sense.

I'm refactoring the gem to stop patching Base by default.

With the multiple database support we need to add it to the abstract record or the model that need it locking.

@seuros
Copy link
Member

seuros commented Mar 3, 2024

@semaperepelitsa , i opened a PR to fix this.

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

No branches or pull requests

2 participants