Using an objet to represent a complex preload

Sometimes just using preload or includes is not possible… or maybe it is, but you just can’t figure it out how to do it.Maybe you want to preload some records matching two keys, or preload a grouped relation.Maybe you know how to represent the association with a has_many :through, but you need something faster, or to use less memory.In that kind of situations, one thing that you can do is to write a custom object to represent that preload.Here I will try to explain how and when you can do it with an example.
Using an objet to represent a complex preload #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/using-an-objet-to-represent-a-complex-preload

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles