Slow loading Rails environment
If you find it annoying that Rails environment, console or tasks takes far too much time, check out snailgun. Snailgun accelerates the startup of Ruby applications by preparing a Ruby process preloaded, and then forking that process whenever a new command-line Ruby interpreter is required. Makes development significantly faster and it can be even used for running tasks in production.
Value Object in ActiveRecord
Although it’s rather pretty hard to be domain driven in Rails using native ActiveRecord pattern (though they say it’s more the matter of rails culture and ecosystem), there are still some neat concepts, for example Value Object.
Value Object has no identity, is immutable, can be easily created and discarded. It is reusable and shareable between various entities. Actually what is it for? It simply contains attributes. It can be object like Address, Money, Point, GeoLocation, string with format limitations (ZipCode, Name), number with limitations (Percentage, Quantity, etc), etc.
You can see it in practice in docs for ActiveRecord::Aggregations. Other rereferences: The Rails3 Way, Domain Driven Design presentation, Domain Driven Design Quickly.
Readable MySQL-like output in rails console or irb
Ever wanted to make irb or rails console output a little more clear and readable? At least something like from mysql console?
You should try hirb for nice output and wirble for nice colouring.
And that’s it. Enjoy it. It made my day the other day.