Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed test_disable_referential_integrity on Oracle

On Oracle disable_referential_integrity before execution of block will disable foreign key constraints and after block will enable them but when constraints are enabled then they are validated. Therefore created record with invalid foreign key should be deleted before enabling foreign key constraints.
  • Loading branch information...
commit 58af0d46cfa4481800bb1c4c26950c717ea1ebdd 1 parent 8360d71
@rsim rsim authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  activerecord/test/cases/adapter_test.rb
View
3  activerecord/test/cases/adapter_test.rb
@@ -151,6 +151,9 @@ def test_disable_referential_integrity
else
@connection.execute "INSERT INTO fk_test_has_fk (fk_id) VALUES (0)"
end
+ # should deleted created record as otherwise disable_referential_integrity will try to enable contraints after executed block
+ # and will fail (at least on Oracle)
+ @connection.execute "DELETE FROM fk_test_has_fk"
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.