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

Use ActiveRecord::Base.locking_enabled? to update the lock field #822

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

dombesz
Copy link
Contributor

@dombesz dombesz commented Nov 22, 2023

Problem

activerecord-import is ignoring the ActiveRecord::Base.lock_optimistically = false flag and it still updates the lock field.

Solution

Use the locking_enabled? method provided by activerecord to decide whether the lock field should be updated.

@jkowens
Copy link
Collaborator

jkowens commented Nov 22, 2023

Makes sense, thanks!

@jkowens jkowens merged commit 22e077b into zdennis:master Nov 22, 2023
18 checks passed
@dombesz dombesz deleted the fix-use-locking-enabled branch November 22, 2023 18:19
@jkowens
Copy link
Collaborator

jkowens commented Mar 15, 2024

Released in v1.6.0 👍

dombesz added a commit to opf/openproject that referenced this pull request Mar 20, 2024
…n because the activerecord-import gem respects it.

The zdennis/activerecord-import#822 got merged and released
in the activerecord-import 1.6.0 which now respects the ActiveRecord::Base.lock_optimistically
setting.
dombesz added a commit to opf/openproject that referenced this pull request Mar 20, 2024
…n because the activerecord-import gem respects it.

The zdennis/activerecord-import#822 got merged and released
in the activerecord-import 1.6.0 which now respects the ActiveRecord::Base.lock_optimistically
setting.
oliverguenther pushed a commit to opf/openproject that referenced this pull request Mar 21, 2024
…n because the activerecord-import gem respects it.

The zdennis/activerecord-import#822 got merged and released
in the activerecord-import 1.6.0 which now respects the ActiveRecord::Base.lock_optimistically
setting.
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.

None yet

2 participants