All blog posts tagged with rails

My Vim setup for Rails development on OS X

October 4, 2009

I've been using Vim for awhile as my primary editor and when I was first starting I did a lot of poking around to see what other peoples setups looked like, so I figured I'd contribute a quick article back to the innernets with my setup.

Only one of the plugins I have installed is actually Rails spe…

Read more

Cached-find: Simple finder caching for ActiveRecord

August 5, 2009

When you have a high traffic app that is going to be repeatedly making the same requests that won't change a lot from the database, It's obviously a good idea to store these results in memory instead of hitting the database every time you need the data.

Rails provides some nice built in caching mec…

Read more

Rails 2.3 count with named scope

April 29, 2009

There is a known bug in Rails 2.3 that is worth being aware of, count no longer works on anything using named_scope. There are some patches and a fix available in the ticket there and it looks like it will be resolved in the next version... but for now, beware!

also, I'm not sure when but somewhere …

Read more

Serialized hashes with partial_updates in Rails 2.1

June 2, 2008

In Rails 2.1, they added partial updates - which is a great idea and a long time coming. This makes ActiveRecord only updates the parts of a model that has actually changed, and also gives you the ability to see if a field (or a record) has changed since retrieving it from the database. (via mode…

Read more

Rails Deployment

January 14, 2008

There is a post on RubyInside today that spawned quite the cascade of comments on the topic of deploying rails. While a lot to wade through, there are some interesting comments buried in there. I still find it strange that everyone is clamoring for a solution, while ignoring one that exists because …

Read more

CruiseControl and custom cruise tasks running in production

September 20, 2007

I found a fun gotcha! today with CruiseControl - if you create a custom cruise task you have to set the RAILS_ENV AND ENV["RAILS_ENV"] to test.

If you do not, CruiseControl will run against your production database. Before CruiseControl invokes it's own built-in cruise task it sets the RAILS_ENV to …

Read more

Netbeans for the win!

September 7, 2007

I have been meaning to write an article about netbeans + ruby for awhile, and anyone who knows me has probably heard me talk about it - it's great, it's fast, and it actually just works. However, somebody else saved me the trouble, infrid over at http://lifeonrails.org wrote an epic post about it, …

Read more

RSpec/Rails view specs and helpers

August 21, 2007

I ran into a situation today where I had to mock out a helper method in a view spec. After a bit of poking around came across Jake Scruggs blog where he has a post titled, appropriately enough, Mocking/Stubbing partials and helper methods in RSpec view tests.

For the lazy, it's just:

@controller.te…

Read more

RSpec on Rails rake task for Recent Specs

June 5, 2007

As our number of specs grow I started to miss the test:recent functionality, so I created a simple little rake task to make it work with RSpec. Drop this in lib/tasks, I called it spec_recent.rake.

require 'spec/rake/spectask'
# Grab recently touched specs
def recent_specs(touched_since)
  recent_s…

Read more

Pluginizing ActionWebService to work on Edge rails

June 4, 2007

I recently updated a project at work to Edge rails to take advantage of ActiveResource - as a result, ActionWebService went away. We've known for a long time AWS was on it's way out, but I was hoping a plugin version would be created prior to it's removal - which in all fairness may still be the cas…

Read more

Enforcing spec coverage with CruiseControl, RCov, and RSpec

June 1, 2007

Now that Alex has gotten CruiseControl.rb setup setup at work, I wanted to use it to enforce good test coverage - and I wanted the output to look good doing it. Turns out this isn't that hard, but requires a few things:

Read more

CodeRay helper for Rails

May 9, 2007

While I'm using Markdown for formatting blog entries, I wanted to have some decent syntax highlighting support as well. After looking around I decided to use CodeRay. It's fast, customizable, has nice output, and is easy to extend. All I had to do to make it work with Rails was to create a helper. I…

Read more

Displaying all 12 posts