-
Notifications
You must be signed in to change notification settings - Fork 187
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Drops validation from belongs_to relations in Rails 5 #94
Comments
I've done some debugging, and this seems to have to do with
to:
then the validation is restored. |
Hope to have this fixed soon. |
Is this still an issue? Seems kinda disastrous. |
I just tried and it no longer occurs with Rails 5.2 and activerecord-session_store 1.1.1. |
It also does not occur with Rails 5.1.6 and activerecord-session_store 1.1.1. However, it does still happens with Rails 5.0.7 and activerecord-session_store 1.1.1. I think projects that have migrated to Rails 5.0 and then to 5.1 and 5.2 may also be affected if they haven't removed |
In Rails 5, a
belongs_to
relation is automatically validated as required. Addingactiverecord-session_store
to theGemfile
of a Rails 5 project removes this automatic validation.This can be reproduced very easily by creating a Rails 5 project with two related models:
In the rails console or a test, it can now easily be verified that a Bar object is invalid without a Foo object:
If
activerecord-session_store
is added to the Gemfile like so,the results are different:
The text was updated successfully, but these errors were encountered: