Ognjen Regoje bio photo

MY NAME IS
Ognjen Regoje
BUT YOU CAN CALL ME OGGY


I make things that run on the web (mostly).
More /ABOUT me.

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

#pattern

2021

December 21, 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)

December 06, 2021

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)

April 27, 2019

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)