Comments (4)
Can you reproduce this bug on Rails 7.1? Rails 6.1 isn't supported anymore
from rails.
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.
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.
Search for def reload
. You will find methods like this
from rails.
Related Issues (20)
- Circular data structures raise SystemStackError when serializing them with `#to_json`. HOT 1
- Mysql2 adapter raises when querying indexes that do not exist HOT 2
- ActiveStorage race condition on attach
- Fix supporting encrypted configuration with integer keys HOT 6
- trilogy: will trilogy support prepared statement HOT 1
- `ActiveRecord::Persistence#becomes` does not clone eager-loading state and can raise Strict Loading violations HOT 4
- normalizes doesn't work with store / store_attributes HOT 1
- Doc Request: ActiveRecord FAQ HOT 3
- Upgrade `marcel` gem to 1.0.3 triggers `ActiveStorage::BlobTest#test_create_and_upload_extracts_content_type_from_filename` failure HOT 3
- where.first_or_create! fails with encrypted attribute fails HOT 3
- ActionView::Helpers::DateHelper #distance_of_time_in_words Leap Day bug HOT 1
- It is not possible to handle "not a valid MIME type" error using the exceptions_app = self.routes when the value of CONTENT_TYPE header is invalid HOT 4
- #update on CPK association requires an explicit reload to work correctly HOT 4
- Postgres JSONB column default and virtual column expressions are not typecasted on save HOT 3
- Avoidable resource consumption when using "in_batches(use_ranges: true)"
- how to write ruby on rails active records query on ubuntu
- Unintended Fallback to `Rails::HTML4::Sanitizer` for `ActionView::Helpers::SanitizeHelper.sanitizer_vendor` without `sprockets-rails` HOT 4
- Unexpected behaviour for CTE joins when CTE has same name as a relation HOT 2
- QueryAttributes treated as strings in exec_query HOT 5
- Configuration of config.i18n.fallbacks is not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails.