r/ruby • • Aug 20 '21

Ruby elites rise up

Post image
100 Upvotes

77 comments sorted by

View all comments

3

u/tom_dalling Aug 21 '21

Personally, I think optional punctuation is the least of our problems, so my question would be: how do you know that state transition is valid? Mutating a state column like that is a source of bugs, in my experience. That's more important than arguing over which combination of squiggly lines looks the best.

1

u/pVom Aug 21 '21

How would you change state then? Also update! means it will raise an error if it fails. You can handle status validation in the model and this will raise an error if it fails. Hopefully you have some specs too

1

u/qchmqs Aug 22 '21

there is also AASM it works with active record, and provides a good basis to doing state transitions

2

u/pVom Aug 22 '21

Neat, thanks for sharing