How To Disable an Observer in Rails

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 […]

Rich Frog: Git with Putty on Windows

When searching for information how to use use PuTTY with git on Windows, I came across this post: Rich Frog: Git with Putty on Windows. The first time I tried to connect to, I wasn’t able to add the server’s host key to the cache. Hitting the ‘y’ key did nothing. In order to […]

How To: Add current commit to Rails template

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+ […]