Sunday 18 July 2010
Deploying Rails 2.3.8 on WebFaction with Nginx, Passenger, Git and Capistrano
Create a Rails 2.3.8 app in your WebFaction control panel: Create your WebFaction account and a new Rails 2.3.8 app. If you require a MySQL or Postgres database, you can add it through the control panel, then update your app’s config/database.yml file with the production database details. Get Git Going G... More
Tuesday 06 July 2010
Deleting Old Ruby on Rails Active Record Sessions Using Whenever and Capistrano
If you’re using the Rails Active Record session store, you’ll notice that it does not delete old sessions. I’ve found this can quickly lead to sessions tables bloated with 100,000 records. I found a good solution on a blog for this, but it required some extra work to get this running with the whenever gem in my... More
Monday 28 June 2010
Rails 3, MySQL gem problems with Mac OS X Snow Leopard
I’ve been trying to get into Rails 3 but have been running into lots of problems that keep sending me back to Rails 2.x with my tail between my legs. The latest problem is when I create a new Rails 3 beta 4 app with MySQL as the default database. I run bundle install and everything looks good, but when I start the app I get the following error: undefined method `init' for Mysql:Class The backtrace ends here: activerecord (3.0.0.... More
Wednesday 16 December 2009 | 2 comments
Stoptoad: Resolve All Hoptoad Errors
Deployed to Heroku for the first time today. Insanely easy! Literally took a matter of seconds. Stoptoad is a utility buit with Sinatra that will mark as resolved all Hoptoad errors. Requires auth token and subdomain name then cycles through all paginated error results until completed. http://gentle-robot-34.... More
Thursday 19 November 2009
Acts As Lockdown
A Rails plugin that addresses the need for certain ActiveRecord attributes to be unwritable when a record has entered a certain state. Take for example a product that begins in a "pending" state, and later enters a "published" state. From that point on, you require that the price and description must not be changed. The plugin assumes that you have a state machine in place that and your object will respond to a query on the state you specify eg self.published? It works... More
