-
Introducing: BabySqueel. Elegant queries for Rails.
Remember the Squeel Ruby gem? It is a really nice way to build complex queries for Active Record in Ruby instead of resorting to SQL strings.
-
A Case for Composition
I’ve read way too many blog posts about inheritance versus composition. All of them revolving around the is-a versus has-a relationship. If that subtlety has left you scratching your head, here’s a real life example.
-
Improving Rails test helpers
A great productivity comes from the small things. When making sure that the app works fine on the new version of Rails, I had to fix failures like this one many many times:
-
Authentication Crash Course with Devise
Devise is a flexible authentication solution for Rails based on Warden. Learn how to add a stable authentication solution like Devise to your application.
-
Send SMS messages like emails in Rails with Textris
The Twilio Ruby helper library makes sending SMS messages with Ruby really easy. In fact, it’s as simple as:
-
How To Make Rails Json Output Decimal Numbers Instead Of Strings
Working on an application I noticed that when getting JSON data from Rails the decimal numbers come as strings. Turns out this is to ensure it is still accurately rounded.If you don’t care about the rounding of large numbers then you can force Rails to output the decimals as numbers.
-
Development Quality for Ruby and Chef
Lately I’ve been questioned about how to maintain a codebase through the years and how to work on/find quality metrics.A lot of people come from previous background where just vi/nano is required to lash out some code and moving to Ruby/Chef it seems only the language changed but there wasn’t much investment on better software development practices.
-
Setting Up A Rails Development Environment Using Docker
A couple of years ago I wrote about how to setup a local development environment using Vagrant. While Vagrant has worked out great, containerization with Docker has become all the rage. So I decided to take it for a spin to see what all the fuss is all about. I’m going to use an existing Rails app as my test subject.
-
Rails Form Objects With dry-rb
Building form objects in modern Rails applications is nothing new. Most Ruby developers are familiar with including Virtus and ActiveModel::Validations to their form objects.
-
Running an IRC Bot in Ruby on OpenShift V3
At Red Hat, all of our instant internal messaging is done through IRC. Because of this, many of our channels have a couple bots in them that do things like process links, report new pull requests, and keep track of users’ karma.