Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix mysql/mysql2 failing with FK constraint errors

One of the author fixture we have ("david") references an author address by ID.
Since we disable FK checks when inserting fixtures, this is all fine until we
try to update it, at which point MySQL would complain about the missing row
referenced by the `author_address_id`.

[Godfrey Chan, Matthew Draper]
  • Loading branch information...
commit c031016558d7be757c9216186670bf3418a1a6ae 1 parent 6787507
@chancancode chancancode authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  activerecord/test/cases/persistence_test.rb
View
2  activerecord/test/cases/persistence_test.rb
@@ -20,7 +20,7 @@
require 'rexml/document'
class PersistenceTest < ActiveRecord::TestCase
- fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics, 'warehouse-things', :authors, :categorizations, :categories, :posts, :minivans, :pets, :toys
+ fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics, 'warehouse-things', :authors, :author_addresses, :categorizations, :categories, :posts, :minivans, :pets, :toys
# Oracle UPDATE does not support ORDER BY
unless current_adapter?(:OracleAdapter)
Please sign in to comment.
Something went wrong with that request. Please try again.