Skip to content

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.

# 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.

@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
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