Commit df804fc2 by John Hawthorn

Test using acts_as_paranoid class without DB

Regression from 6881e750

We need to be able to load our class definitions without having an
available database connection.
parent c5ca7559
...@@ -625,6 +625,14 @@ class ParanoiaTest < test_framework ...@@ -625,6 +625,14 @@ class ParanoiaTest < test_framework
assert_equal 3, parent.very_related_models.size assert_equal 3, parent.very_related_models.size
end end
def test_model_without_db_connection
ActiveRecord::Base.remove_connection
NoConnectionModel.class_eval{ acts_as_paranoid }
ensure
setup!
end
private private
def get_featureful_model def get_featureful_model
FeaturefulModel.new(:name => "not empty") FeaturefulModel.new(:name => "not empty")
...@@ -763,3 +771,6 @@ class AsplodeModel < ActiveRecord::Base ...@@ -763,3 +771,6 @@ class AsplodeModel < ActiveRecord::Base
raise StandardError, 'ASPLODE!' raise StandardError, 'ASPLODE!'
end end
end end
class NoConnectionModel < ActiveRecord::Base
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment