Posts Tagged ‘ code ’

Creating, Sending, and Verifying CSV files using Comma

2010/08/13
By noelrap
Creating, Sending, and Verifying CSV files using Comma

Here’s something I haven’t done in a while — a genuine code blog entry. I needed to add a simple CSV file output, here’s how I did it, tests and all. I used two gems, FasterCSV, which I assume that most of you are familiar with, and Comma, which is a nice little DSL...
Read more »

Tags: ,
Posted in Publishers, Rails Prescriptions | View Comments

Using BETWEEN for SQL comparisons

2009/11/14
By Robby Russell
Using BETWEEN for SQL comparisons

Recently, Carlos, suggested that I should start sharing some basic SQL tips that help with performance and/or general usage. I recently came across some code that I didn’t like to read and/or write. For example, let’s take the following…


SELECT * FROM brochures WHERE published_at <= now() AND archived_at >= now()

Essentially, this is pulling...
Read more »

Tags: , , , , , ,
Posted in Publishers, Robby on Rails | View Comments

The 8-Hour Rails Code Audit

2009/10/20
By Robby Russell
The 8-Hour Rails Code Audit

While our team is typically focused on larger client and internal projects, we do get an opportunity to assist businesses on a much smaller scale. Whether this be through retainer-based consulting or through code audits, we have seen a lot of Ruby on Rails code over what has nearly been… five years!? We’ve been...
Read more »

Tags: , , , , , , , , ,
Posted in Publishers, Robby on Rails | View Comments

Flash Message Conductor now a Gem

2009/10/13
By Robby Russell
Flash Message Conductor now a Gem

We’ve been doing some early (or late… if you’re a half-full kind of person) spring cleaning on some of our projects. One of the small projects, flash_message_conductor, which we released last year as a plugin is now a gem. We’ve been moving away from using plugins in favor of gems as...
Read more »

Tags: , , , , , , ,
Posted in Publishers, Robby on Rails | View Comments

Planting the seeds

2009/09/05
By Robby Russell
Planting the seeds

Yesterday, the Rails team released 2.3.4, which includes standardized way for loading seed data into your application so that you didn’t have to clutter your database migrations.

I noticed a few comments on some blogs where people were asking how to use this new feature, so here is a quick runthrough a few ways that...
Read more »

Tags: , , , , , , , , , , ,
Posted in Publishers, Robby on Rails | View Comments

Using model constants for project sanity

2009/06/22
By Robby Russell
Using model constants for project sanity

On one of our larger client projects (approx. 160 models and growing…) we have a specific model that we refer to quite a bit throughout our code. This model contains less than 10 records, but each of them sits on top of an insanely large and complex set of data. Each record refers to...
Read more »

Tags: , , , , , , , ,
Posted in Publishers, Robby on Rails | View Comments

Subdomain accounts with Ruby on Rails explained

2009/01/11
By Robby Russell
Subdomain accounts with Ruby on Rails explained

DHH recently posted, How to do Basecamp-style subdomains in Rails on SvN and it just happens that I was implementing some similar stuff this last week for a project we’re developing internally.

In our project, not everything needs to be scoped per-account as we are building a namespace for administrators of the application...
Read more »

Tags: , , , , , , , , ,
Posted in Publishers, Robby on Rails | View Comments

The HTTParty has just begun

2008/11/26
By Robby Russell
The HTTParty has just begun

After releasing the new RubyURL API, I decided that it was time to look around at libraries to interact with it. I came across a new Ruby gem from John Nunemaker named, HTTParty, which aims to make it easy to talk to XML and JSON-based web services. Be sure...
Read more »

Tags: , , , , , , , , , , , ,
Posted in Publishers, Robby on Rails | View Comments

Lesson Learned: Git Ref Naming

2008/09/18
By Robby Russell
Lesson Learned: Git Ref Naming

Our team has been working our way into the Git world. One of our big client projects is now 100% git while the other is still on Subversion for another month or so. (I’m getting by with git-svn, the gateway drug on that). We’ve had pretty much nothing but success with Git for...
Read more »

Tags: , , , , ,
Posted in Publishers, Robby on Rails | View Comments

RSpec: It Should Behave Like

2008/08/19
By Robby Russell
RSpec: It Should Behave Like

I was going through an older project of ours and cleaning up some specs and noticed how often we were doing the same thing in several places. When we started the project, we didn’t get the benefits of shared groups. Now that we have some time to go through and update some of our...
Read more »

Tags: , , , , , , , , , ,
Posted in Publishers, Robby on Rails | View Comments