-
-
Notifications
You must be signed in to change notification settings - Fork 913
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
Clear up confusion w/ presence around belongs_to associations. (#1214) breaks existing behaviors. #1218
Comments
The presence validation calls That said, I can change it so that it only acts on an ActiveRecord model so that your tests pass again. |
@kamillle Looking back at this, I'm having trouble writing a failing test for this based on your example. Are your tests breaking currently, and if so, which ones? |
@mcmire oops...
|
@kamillle Hey, I just pushed up a branch, |
@mcmire Sure. I'll check that!! Thank you!😍 |
@mcmire The fix is completely working in my case!!! Appriciate your working.😆🙌🙌 |
This fix is live in v4.1.1. |
v4.1.0
includes a changeClear up confusion w/ presence around belongs_to associations.
(#1214 ) . This breaks existing behaviors.My application code is below.
And test code is below.
When execute
it { is_expected.to validate_presence_of(:user) }
, then user attribute is insertednil
until v4.0.1, but in v.4.1.0 user attribute is inserted""
(empty string) andvalidates :note, presence: true, if: %i[user]
is run unintentional.Why did you determine to change the behavior? and why not restore the behavior?
The text was updated successfully, but these errors were encountered: