diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-05 04:37:05 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-05 04:37:05 +0000 |
commit | 8d6d450303235101a66624691e98986e0a8d6ff6 (patch) | |
tree | bde0b946c55085fb0529da11a6b650c25d58a10e /activerecord | |
parent | 255b913637ede72b250b36abba033de2518c4969 (diff) | |
download | rails-8d6d450303235101a66624691e98986e0a8d6ff6.tar.gz rails-8d6d450303235101a66624691e98986e0a8d6ff6.tar.bz2 rails-8d6d450303235101a66624691e98986e0a8d6ff6.zip |
Fixtures: correctly delete and insert fixtures in a single transaction. Closes #8553.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6944 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/fixtures.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 527e7c4510..e56b12f274 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fixtures: correctly delete and insert fixtures in a single transaction. #8553 [Michael Schuerig] + * Fixtures: people(:technomancy, :josh) returns both fixtures. #7880 [technomancy, Josh Peek] * Calculations support non-numeric foreign keys. #8154 [kamal] diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 0a8b75e014..61a5ef2af8 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -255,7 +255,7 @@ class Fixtures < YAML::Omap all_loaded_fixtures.merge! fixtures_map - connection.transaction(Thread.current['open_transactions'] == 0) do + connection.transaction(Thread.current['open_transactions'].to_i == 0) do fixtures.reverse.each { |fixture| fixture.delete_existing_fixtures } fixtures.each { |fixture| fixture.insert_fixtures } |