I got my first contribution to Rails codebase merged last week. It’s an improvement to documentation, that explains how to fully utilise parametric scopes.
Category: Ruby & Rails
Scaffolding in Rails 7 is amazing
I’m continuously being impressed by the productivity and ease of use enhancements Rails keeps making after all these years it has been around.
Easily switch or experiment with different databases in Rails
I just learned about rake db:system:change task that Rails provides, to speed up switching between different database engines. If you’re experimenting with something, or benchmarking things, this is super useful.
Starting new Rails applications
It’s been a while since I reviewed the documentation for rails new console command. There are a few useful features that I didn’t know about:
Speeding up office work with Ruby and IRB
I was just paying taxes ?. One of the steps involved was copying and pasting a few long reference numbers from a PDF into my banking app. The thing is, when copied, the reference number would contain extra spaces, after each character, making it invalid where I needed to paste it.
Don’t forget about X-Forwarded-Host header
Recently I was working on a Rails application on Heroku living behind a reverse proxy. This application serves requests coming to a specific folder on the target domain. For it to correctly generate full URLs, you have to somehow tell this app the hostname you want it to use. In Rails, you can configure a hostname in the environment config file, but that’s a static value, which has to be maintained and changed per environment. Also it does not work well if you want to access the application from multiple domains.
CRM system
Integrated business management web app for a sales company with CRM features. The functionality this Rails app provides is extensive:
Speeding up bundle install with in-memory file system
On some of the servers I work with, due to cheap hard drives in software RAID configuration, I’ve found that bundle install can be extremely slow (take half an hour to complete). This obviously became unacceptable during deploys.
Effort – Personal To-do and Project manager
I open sourced a Rails app that I’ve been personally using for years for simple project management. The code is available on Github under the MIT license. From the README:
EQAFE – Ecommerce
This is one of the first projects where I started using Rails in production. EQAFE developed—over the years—from a simple checkout page to sell a single book to an ecommerce platform featuring thousands of products, affiliate program, gifts and more.