Fix immutability ROM objects #40
Labels
priority:low
Low priority
status:in-review
In Review status
type:refactoring
Adjustments that are necessary during the course of the project.
Summary 🔴
In the auction completion task, a different behavior was noticed than the standard of most ORM's that use OO. When an object is updated in the database, the object itself already carries the update made (activerecord is like this, for example). However, we are using rom-rb which, behind the scenes, makes use of object immutability (which is quite performant in terms of GC). Although we gain in performance, in most cases we need the behavior in which the object returns updated, thus being able to return it to the flow of operations.
Proposed / Possible solution 🔴
ROM-RB, in its update operation, updates the db, however, returns a new object. This new object, however, in the case of standard attributes, returns the default values and not the updated values. With this in mind, we will make the following changes outlined in the checklist.
Checklist
Additional
Related issues
#4, #33
The text was updated successfully, but these errors were encountered: