News for hackers. Stuff that matters.
Re:Reducing Memory Usage in Ruby by sam0x17 on Wednesday January 24, 2018 @02:37AM (#16221047)
See GraniteORM or my crystal-mongo-orm. You just have to specify your fields at compile time and you are good-to-go. It works just like active record.

https://github.com/amberframework/granite-orm https://github.com/sam0x17/crystal-mongo-orm

Re:Reducing Memory Usage in Ruby by eropple on Wednesday January 24, 2018 @12:18PM (#16224351)
"You have to specify your fields at compile time" is exactly not like ActiveRecord, though. That's exactly the downside to it for doing ActiveRecord.

At that point, you may (should) just use an object mapper like ROM that has no model-class hooks at all. (Which I actually like. But the Rails world disagrees.)

Re:Reducing Memory Usage in Ruby by sam0x17 on Monday January 29, 2018 @04:10PM (#16260642)
You effectively do specify your fields before runtime in Rails, though, in the form of your migrations. Furthermore all of the associations (belongs_to, etc), are arguably also specified before runtime since those helpers run when the class is parsed.
Re:Reducing Memory Usage in Ruby by eropple on Friday February 09, 2018 @02:20AM (#16338521)
I frequently don't use Ruby-based migrations. I use datastores defined elsewhere and use Sequel as a convenient and easy interface for tasks against those datastores.

You're trying to slice too fine. Crystal can't do this. That's OK. Own it, don't try to hide it.