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 deprecation warning for uniqueness matcher (Rails 4.2) #1073

Merged
merged 1 commit into from
Jan 24, 2018

Commits on Jan 24, 2018

  1. Fix deprecation warning for uniqueness matcher (Rails 4.2)

    The uniqueness matcher needs to set the attributes under test (which is
    not only the attribute you give to the matcher, but also any scope
    attributes as well) to arbitrary values so that it can test the
    underlying uniqueness validation logic. To set an attribute correctly,
    it needs to check what type of column that attribute is and then
    generate a value that matches the column (otherwise unpredictable
    results happen). The matcher was doing this for scope attributes, but
    not for the main attribute. One of the consequences of this
    inconsistency is that when setting a boolean attribute, it was using a
    string value, which generates a warning under Rails 4.2.
    
    This commit fixes this so that the main attribute is set the same way as
    scope attributes, thereby removing the warning.
    mcmire committed Jan 24, 2018
    Configuration menu
    Copy the full SHA
    9103ead View commit details
    Browse the repository at this point in the history