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

Remove redundant deletion of feature gate in Flipper::Adapters::ActiveRecord#set. #862

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

khiet
Copy link
Contributor

@khiet khiet commented Apr 18, 2024

Hello, I noticed the duplicate deletions in Flipper::Adapters::ActiveRecord#set
The Flipper::Adapters::ActiveRecord#delete already does the same destroy_all.

@@ -3,7 +3,7 @@ module Flipper
#
# adapter = Flipper::AdapterBuilder.new do
# use Flipper::Adapters::Strict
# use Flipper::Adapters::Memoizer
# use Flipper::Adapters::Memoizable
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unrelated to the PR but I thought I added this small typo fix. I'm happy to create another PR for this if that's more appropriate.

@@ -221,7 +221,6 @@ def set(feature, gate, thing, options = {})
@gate_class.transaction do
clear(feature) if clear_feature
delete(feature, gate)
@gate_class.where(feature_key: feature.key, key: gate.key).destroy_all
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The above delete does the same destroy_all.

Copy link
Collaborator

@bkeepers bkeepers left a comment

Choose a reason for hiding this comment

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

Thanks!

@bkeepers bkeepers merged commit 13c415c into flippercloud:main Apr 19, 2024
36 checks 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.

2 participants