top | item 38214890

(no title)

andsbf | 2 years ago

`...If you call model.update(params) in Ruby, then it returns false if it fails and updates model.errors with what went wrong. Mutable state.`

This is Rails stuff, not Ruby

discuss

order

krainboltgreene|2 years ago

True, you could implement Ecto exactly in Ruby, except you'd be writing effectively Elixir and every library released that got close to this in the 15 years I've been doing Ruby has been either disliked or disregarded. Each with less contributor activity in their lifespan than a month of ActiveRecord attention.

ljm|2 years ago

Yeah, the example is Rails-specific but Ruby is full of methods that mutate existing state. Most of the time they're marked with `!` at the end, but not always.