Follow

AMA: One week updating multiple Rails 5.x to Rails 5.2.1 (current as I write this 20180911).

We experienced some issues, the most problematic so far has been 5.0.2 -> 5.2.1 where a super tiny change broke a fairly new and untested* feature related to http headers. ActiveRecord changes was also hard, but IMO needed.

Takeaway for us? Unless you have a very good reason: Update your gems frequently.

* Untested because we assume we should not be testing what was probably tested by the framework.

@esparta are there a lot of change even between not so major version?

@vigdis it depends...

On the ActiveRecord side:

levups.com/en/blog/2017/undocu

If your code base relays a lot on calling helpers related to previous dirty values while/within after_* callbacks, then yes - fortunately we don't.

This previous working code:

```
class Account
after_update :do_special_processing , if: critical_field_changed?
end
```

Needs to be rewrited:

```
class Account
after_update :do_special_processing , if: saved_change_to_critical_field?
end
```

YMMV.

@esparta I see. The only Rails app I'm closed to is the mastodon instance I host. It was out of curiosity, releng-wise. Thanks!

@vigdis ohhh I see.

If you ever do a Rails app then don't use models callbacks. Ever. Unless. No, fight it.

Sign in to participate in the conversation
Ruby.social

A Mastodon instance for Rubyists & friends