Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix immutability ROM objects #40

Closed
3 tasks done
ricardopacheco opened this issue Apr 22, 2024 · 0 comments · Fixed by #41
Closed
3 tasks done

Fix immutability ROM objects #40

ricardopacheco opened this issue Apr 22, 2024 · 0 comments · Fixed by #41
Assignees
Labels
priority:low Low priority status:in-review In Review status type:refactoring Adjustments that are necessary during the course of the project.

Comments

@ricardopacheco
Copy link
Owner

ricardopacheco commented Apr 22, 2024

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

  • Removing default values from relations.
  • Rebuild factories to not contain default values (but rather be set manually or built from traits).

Additional

  • Add automated tests for auction relations

Related issues

#4, #33

@ricardopacheco ricardopacheco self-assigned this Apr 22, 2024
@ricardopacheco ricardopacheco converted this from a draft issue Apr 22, 2024
@ricardopacheco ricardopacheco moved this from Ready to In progress in AuctionFunCore Apr 22, 2024
@ricardopacheco ricardopacheco added status:in-review In Review status priority:low Low priority type:refactoring Adjustments that are necessary during the course of the project. labels Apr 22, 2024
@ricardopacheco ricardopacheco moved this from In progress to In review in AuctionFunCore Apr 22, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in AuctionFunCore Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:low Low priority status:in-review In Review status type:refactoring Adjustments that are necessary during the course of the project.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant