1. 4

  2. 2

    Hate to be that guy but I can’t believe it is 2018 and the Rails world still holds so tightly to the active record pattern despite it hurting so much.

    1. 2

      OP here.

      It’s a legacy Rails app from 2011. Moving the whole chunk to something other than the AR pattern is not feasible, nor will it ever be.

      The best we can do is to rewrite pieces of it at a time with better patterns, and that’s exactly what we are doing now.

      1. 1

        Much of the perceived productivity wins that out-of-the-box Rails provides are derived from the tight coupling between ActiveRecord (or at least ActiveModel) and the rest of the provided libraries. I agree it is a hindrance, but choosing not to use it in the initial phases of a project causes other sorts of friction unless you really know the ecosystem and know what you want to do instead. After all, isn’t ActiveRecord almost half of the lines of code in Rails in the first place?

        With respect to tests, the community’s preference for factory libraries (instead of the built-in fixtures) exacerbates the performance issue quite a bit.