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 presence matcher against an AM record #1231

Merged
merged 4 commits into from
Jul 9, 2019

Conversation

mcmire
Copy link
Collaborator

@mcmire mcmire commented Jul 7, 2019

When using the presence matcher against an ActiveModel record, check to
ensure that the model is using the Attributes API and has explicitly
declared the attribute to be a string before attempting to set the
attribute to an empty string. Otherwise, the attribute may be getting
treated as an object in some point in the validation process, and
therefore setting it to an empty string would create problems.


Fixes #1218.
Fixes #1228.

mcmire added 4 commits July 8, 2019 19:24
...in preparation for detecting models that support the full Attributes
API more closely.
When using the presence matcher against an ActiveModel record, check to
ensure that the model is using the Attributes API and has explicitly
declared the attribute to be a string before attempting to set the
attribute to an empty string. Otherwise, the attribute may be getting
treated as an object in some point in the validation process, and
therefore setting it to an empty string would create problems.
@mcmire mcmire force-pushed the fix-presence-validation-for-activemodel branch from 11f4483 to b3025dc Compare July 9, 2019 01:31
@mcmire mcmire merged commit b3025dc into master Jul 9, 2019
@mcmire mcmire deleted the fix-presence-validation-for-activemodel branch July 9, 2019 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant