4 ms·
The article has this gist: user.log_entries.delete_all user.log_entries.create!(message: "User account reset") user.log_entries #=> [], will be empty unt
by pqdbr 1y ago
The article has this gist:
user.log_entries.delete_all
user.log_entries.create!(message: "User account reset")
user.log_entries #=> [], will be empty until reloaded
This is false. At least not in Rails 7+ (haven't tested earlier), user.log_entries will return exactly what you'd expect (one instance of LogEntry).
- deleted 1y ago[deleted]
- julik 1y agoOP here - for what it's worth, this was the case on our application which was Rails 8. Some other gem or workflow may have been involved, but is highly unlikely.