Rails 3 and AuthLogic NameError: undefined local variable or method `activate_authlogic' for

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

Installing Ruby 1.9.1, Rails 2.3.2 and PostgreSQL on Windows Vista

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

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

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