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

🥗🧹 Tobias: Models have their Relationships and Attributes defined #20

Conversation

zspencer
Copy link
Member

This is perhaps a bit "extra" but I find appeasing the Rails gods by declaring Model attributes and relationships (plus their inverses and their dependent behavior) explicitly results in code that is easier to read and understand.

It could be argued a strong type system would eliminate all of this; which is why the Cool Kids have moved to Rust and Elixir.

I'm not a Cool Kid tho.

While it may be better us to void a `Payout`, making sure we clean up
any `Payout#payments` upon `Payout#destroy` should reduce the likelihood
of data being in a sad place.
This is not super important to the actual feature, but it does mean that
the `Payment` has clearly defined relationships, with tests that confirm
the relationship.

It also adds a spec to check that the `#amount` value operates as a
monetized value; which doesn't seem like it does that much beyond giving
us an injection point for layering in additional details.
A few more `Payout` bits that didn't have specs! Now they do!
Again, we may want to leverage an archival system rather than
destruction, but for now let's make sure we clean up when a `Trust` is
detroyed.
@zspencer zspencer force-pushed the tobias/payout/destroying-a-payout-destroys-payments branch from a235550 to 9ad211f Compare January 30, 2024 00:00
@zspencer zspencer changed the title 🧹 Tobias: Models have their Relationships and Attributes defined 🥗🧹 Tobias: Models have their Relationships and Attributes defined Jan 30, 2024
@zspencer zspencer merged commit 5bf375c into tobias/issuing-payouts Jan 30, 2024
3 checks passed
@zspencer zspencer deleted the tobias/payout/destroying-a-payout-destroys-payments branch January 30, 2024 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant