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

Uniqueness: Fix when scope set to nil beforehand #665

Merged
merged 2 commits into from
Feb 14, 2015

Conversation

mcmire
Copy link
Collaborator

@mcmire mcmire commented Feb 13, 2015

Fixes #521.

Although the tests already passed before for the simple case, this likely also fixes #607.


Switch the order of how the column type is detected so that string comes
last. This fixes a bug where if the scope was a text column but was set
to nil before running the matcher, the matcher would fail.


it 'still accepts if the scope is unset beforehand' do
record = build_record_validating_uniqueness(
scopes: [ build_attribute(name: :scope, value: nil) ]

Choose a reason for hiding this comment

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

Space inside square brackets detected.

Switch the order of how the column type is detected so that string comes
last. This fixes a bug where if the scope was a text column but was set
to nil before running the matcher, the matcher would fail.
@mcmire mcmire force-pushed the ew-uniqueness-scope-nil-before branch from aa48800 to 226ce5b Compare February 14, 2015 00:11
@mcmire mcmire merged commit 226ce5b into master Feb 14, 2015
@guialbuk guialbuk deleted the ew-uniqueness-scope-nil-before branch April 23, 2017 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants