Ram S
Ram S

Reputation: 25

ActiveRecord - change in behaviour after rails upgrade from 6.1.7.6 to 7.0.1.7

We have similar logic in our application and that was working fine with rails version 6.1.7.6. After upgrading to rails 7.0.1.7, update_attribute method call at line 35 also inserting records into schedule_runs, formats and format_lines tables for the objects initialized lines at 23, 7 and 18. Data getting corrupted for master data formats and format_lines.

However, I could not reproduce it in this project.

https://github.com/ramponnamanda/rails-issue

I reviewed release notes for could not find anything around this change in behavior.

Then I tried a couple of fixes, that prevented data corruption and insertion of records into schedule_runs(commits below). But not sure if it is right way to fix it.

https://github.com/ramponnamanda/rails-issue/commit/264cdd7a29172702b0c88d91b0ab255d3b9ae472

https://github.com/ramponnamanda/rails-issue/commit/2aa01c1db952fac27a2b7d9cf0f4173ce9c60e75 (chose this for time being)

Could someone please explain why there a change in behavior after upgrade? Any flags/configuration that will make it work like before upgrade? any possible repercussions with fixes that I've tried? What is the best way to fix this issue?

enter image description here

Upvotes: 0

Views: 110

Answers (0)

Related Questions