I am dealing a good deal of legacy code that is not very friendly to the database with a ton of nested n + 1 calls. I am slowly replacing them with code that takes advantage of eager associations, nested four levels deep, which works phenomenally well for this particular use case as each parent model instance has a fairly small number of associated rows.
However the logic in the legacy code dynamically creates new rows in first association's model (and those continuing three more levels). When I call `refresh`, none one of the nested associations are reloaded. I assume this is related to the fact that a refresh is not actually using the dataset.all method. One of the other constraining factors I'm facing is that all of this code was written at the class level, so I can't simply memoize data with instance variables. Is there any simply way to have refresh or reload eager load all nested associations? Incidentally, if all that weren't enough, we're running a 4.x version of Sequel, so I am sure I am missing out on a lot of new features. As always, thanks for this magnificent gem! -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/0505bd38-fbb9-45cd-b71f-fa16d324a3cen%40googlegroups.com.
