Update: Fixed the command to create the application. A few days ago I discovered Red Hat’s OpenShift service for hosting web applications in the cloud. Currently, you can host up to three applications for free which is nice, and performance is quite acceptable as well. In order to host tracks on OpenShift, you can use […]
Update 04/17/2013: I’ve figured out how to get the stats page working. See below. I took a fair amount of notes the last time I did a tracks installation on Dreamhost. This is using Tracks version 2.2.1. First Steps Create a new domain on Dreamhost with a separate user. Dreamhost uses a daemon that kills […]
To get the shoulda macros that clearance provides working in your controller specs, use: in your ‘spec_helper.rb’.
This post is a reminder to myself mostly. If you’re getting the following error when using Ruby on Rails 3 with AuthLogic: NameError: undefined local variable or method `activate_authlogic’ for Then you need to edit your test_helper.rb to include AuthLogic: require ‘authlogic/test_case’ class ActiveSupport::TestCase # … include Authlogic::TestCase # … end
I’ve been working on a Ruby on Rails program for my work for quite a while now, and it’s getting near time to ship. There have been a couple of by-products that have come out from my work on that program that I’ve released to my Github account. track_changes – An audit logging filter for […]
Missing String#ord in Ruby 1.8? Here’s a simple monkey-patch that will add it to Ruby. unless “”.respond_to?(:ord) class String def ord self.ord end end end http://gist.github.com/251465
I’ve posted an update to How To Disable an Observer in Rails.
This is a short write up on how I installed my Rails development environment on Windows Vista. If you have any trouble, consult the notes section at the bottom. Update: I missed the part about installing the devkit, thanks to Roger Pack on the Rubyinstaller-devel mailing list. I also added a section for references. Downloads […]
I wanted to disable an ActiveRecord::Observer during a migration in my Rails application. For the record, simply: Payment.delete_observers Update: October 17, 2009 The previous code is problematic, it will disable the PaymentObserver for the entire test run. I’ve now switched to the following technique: class OrderTest < ActiveSupport::TestCase include FlexMock::TestCase context "with observers disabled" do […]
I wanted to add the current revision of a Rails project to my layout so I can easily know what version the current code base is running. I came up with a short initializer that can be added to define a global constant for the commit id and commit timestamp. # RAILS_ROOT/config/initializers/tag_revision.rb # Call +git+ […]