Skip to content

Conversation

@RJV333
Copy link

@RJV333 RJV333 commented Dec 31, 2025

What is the goal of this PR and why is this important?

And add a field to the event model to capture the amount the event could cost.

At this point, I opted to allow null values and default to null to distinguish between events with an unassigned cost (NULL) and a free event (0 cents).

Another baby PR to get. my feet wet. Thanks for any feedback

Copy link
Collaborator

@maebeale maebeale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Solid thinking re nil vs 0!

I know this is just the db, but will prob be a good idea to add a validation like this to the model when you go to add it and cost_cents to strong_params.

validates :cost_cents, numericality: { greater_than_or_equal_to: 0 }, allow_nil: true

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.

2 participants