1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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]
This commit is contained in:
Godfrey Chan 2014-07-05 13:24:24 -07:00
parent 6787507883
commit c031016558

View file

@ -20,7 +20,7 @@ require 'models/toy'
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)