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

Fix double enable of actor/group unique error #313

Merged
merged 3 commits into from Nov 27, 2017
Merged

Fix double enable of actor/group unique error #313

merged 3 commits into from Nov 27, 2017

Conversation

@jnunemaker
Copy link
Owner

@jnunemaker jnunemaker commented Nov 27, 2017

As reported in #296 (comment):

One issue I had to work around was that double-enabling a feature for an actor or group threw a Postgres exception for violating the index_flipper_gates_on_feature_key_and_key_and_value unique constraint on the gates table. So I've got an enable_once wrapper that does a check-and-set to avoid the exception in the initializer that sets up basic rules and the rake tasks that perform administration.

This fixes that for Active Record and Sequel by adding shared adapter tests and swallowing the unique errors. I think this is fine as enabling something that is already enabled should return the same result as enabling it the first time.

…cord
@jnunemaker jnunemaker self-assigned this Nov 27, 2017
jnunemaker added 2 commits Nov 27, 2017
I think this should snag it.
@jnunemaker jnunemaker merged commit d4a1c88 into master Nov 27, 2017
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jnunemaker jnunemaker deleted the double-enable branch Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.