Ognjen Regoje bio photo

Ognjen Regoje
But you can call me Oggy


I make things that run on the web (mostly).
More ABOUT me and my PROJECTS.

me@ognjen.io LinkedIn
Check out
The Marketplace Guide
A collection of lessons for the early stages of building a marketplace startup.
https://themarketplace.guide

#pattern

2021

Automatically creating plural models in Rails

At times it's more readable to use the plural of a model instead of singular. For instance Products.for_indexing instead of Product.for_indexing. This can be accomplished through a simple initializer that creates the plural model automatically. (315)

Functional model pattern

Similar to the actor model pattern, the functional model pattern creates multiple models that operate on the same table. But instead of focusing on the user type that primarily accesses it, it focuses on the functionality required. It works well for different stages of a base model. (685)

ActorModel pattern in Rails

Something I’ve been using that I’ve referred to as ActorModels. Not sure if I’ve seen it documented elsewhere.Basically, it’s subclassing a model based on who’s using it and kee... (438)