Permalink
Browse files

Fix ActiveRecord 2.0.0 - 2.2.3 integrations failing if version info i…

…sn't already loaded [#41 state:resolved]
  • Loading branch information...
1 parent 6ac8f4b commit e9f8f0e4a22c9adae86e57734cad4574f6487bb6 @obrie obrie committed Apr 26, 2010
View
@@ -1,5 +1,6 @@
== master
+* Fix ActiveRecord 2.0.0 - 2.2.3 integrations failing if version info isn't already loaded
* Fix integration with dirty attribute tracking on DataMapper 0.10.3
* Fix observers failing in ActiveRecord 3.0.0.beta4+ integrations
* Fix deprecation warning in Rails 3 railtie [Chris Yuan]
@@ -323,6 +323,7 @@ def self.matches?(klass)
end
def self.extended(base) #:nodoc:
+ require 'active_record/version'
require 'state_machine/integrations/active_model/observer'
::ActiveRecord::Observer.class_eval do
@@ -12,10 +12,9 @@
require 'active_support/test_case'
require 'active_record/fixtures'
-require 'active_record/version'
-if ActiveRecord::VERSION::STRING >= '2.1.0'
+begin
require 'active_record/test_case'
-else
+rescue LoadError
class ActiveRecord::TestCase < ActiveSupport::TestCase
self.fixture_path = FIXTURES_ROOT
self.use_instantiated_fixtures = false

0 comments on commit e9f8f0e

Please sign in to comment.