DEV Community

Discussion on: Rails 5.2.x --> Rails 6 counter_cache Gotcha

Collapse
 
swiknaba profile image
Lud

In an object oriented world, I believe we should pass objects around, not properties of objects. I guess that's what you mean with "idiomatic" already. Of course there are exceptions, e.g. when passing it to an asynchronously called worker, to avoid problems when dumping the payload into Redis as a json value, but usually you instantiate the object in said worker in the first line, to continue working with, well, objects.

Besides this, thank you for sharing your experience in this article, you're for sure not the only one running into this problem :-)