technoweenie / model_stubbing

Replacement for ActiveRecord fixtures using an extremely flexible ruby-based approach.

This URL has Read+Write access

model_stubbing / init.rb
100644 10 lines (10 sloc) 0.309 kb
1
2
3
4
5
6
7
8
9
10
# hack for rails 2.1 and below
config.after_initialize do
  unless ActiveRecord::Base.connection.respond_to?(:increment_open_transactions)
    class << ActiveRecord::Base.connection
      def increment_open_transactions
        ActiveRecord::Base.send(:increment_open_transactions)
      end
    end
  end
end