-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Updating a record with has_one polymorphic association deletes this associated record from DB #3654
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
Comments
@kotsiuruba did you ever come right with this issue? We're having a similar issue after upgrading the rails admin gem from Specifically looks like behaviour changes in the gem upgrade from |
@rebeccacrompton unfortunately no. To prevent deletions we made that field "read only":
|
Our product is encountering the same update issue, causing us to revert to version 2.2.1. However, we are also trying to upgrade to Rails 7, and version 2.2.1 isn't compatible with it. Consequently, we are stuck on Rails 6 until this issue is resolved or we move to ActiveAdmin or a similar alternative. |
Was there ever fixed? Still seeing it |
We are currently trying to do this upgrade again. So, I'm not sure if we are going to experience it again. @Mikewa33, are you saying that you are seeing it? |
I am on 3.0 an seeing it |
Well that is a let down... What version of Rails are you on? |
Describe the bug
I have two models:
and
rails_admin.rb
configuration for the Level modelGemfile
configurationUI works pretty well and allows me to create a notification from the Edit Level page
But when I submit the edit level form assigned notification is going to be deleted from the DB
Expected behavior
has_one
association should be still assigned to the edited recordAdd any other context about the problem here.
When I tried to change association from
has_one :notification
tohas_many :notifications
with the same configuration editing works as expected.The text was updated successfully, but these errors were encountered: