Code Monkey home page Code Monkey logo

Comments (4)

rafaelfranca avatar rafaelfranca commented on July 22, 2024

Can you reproduce this bug on Rails 7.1? Rails 6.1 isn't supported anymore

from rails.

GeoffreyOnRails avatar GeoffreyOnRails commented on July 22, 2024

Well, since I have a hard time reproducing it, it would mean upgrading the platform, which will take some time.
But if I find an easy way to reproduce I'll try on the latest version.

from rails.

GeoffreyOnRails avatar GeoffreyOnRails commented on July 22, 2024

A little bit of update, I have trouble reproducing it on a small project, but I have been able te debug it a bit more.

When calling reload on an activeRecord model, I start to have different instances of AttributeSet, and only one of them is updated when using the setter. Therefore, the object changes method returns empty, and the save doesn't send any update query, as it expects nothing has changed.
After calling a save, things are going back to normal (i.e the same AttributeSet on both places), and changes are tracked appropriately.

object.send(:mutations_from_database).instance_variable_get(:@attributes).to_s
#<ActiveModel::LazyAttributeSet:0x0000000111c8af70>
object.instance_variable_get(:@attributes).to_s
#<ActiveModel::LazyAttributeSet:0x00000001124caa00>

Given that there have been very little changes there between 6.1 and 7.1, I suspect the bug is still present.

How could I track more what happens during a reload on those objects?

from rails.

rafaelfranca avatar rafaelfranca commented on July 22, 2024

Search for def reload. You will find methods like this

from rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.