This project is archived and is in readonly mode.
Association Preload should quote table names
-
Michael Koziarski
Applying this causes stacks of errors:
1418 tests, 4864 assertions, 2 failures, 70 errors
Most of them are:
test_eager_with_invalid_association_reference(EagerAssociationTest):
IndexError: string not matched
./test/cases/../../lib/active_record/fixtures.rb:621:in `[]='
./test/cases/../../lib/active_record/fixtures.rb:621:in `insert_fixtures'
./test/cases/../../lib/active_record/fixtures.rb:604:in `each'
./test/cases/../../lib/active_record/fixtures.rb:604:in `insert_fixtures'
./test/cases/../../lib/active_record/fixtures.rb:575:in `each'
./test/cases/../../lib/active_record/fixtures.rb:575:in `insert_fixtures'
./test/cases/../../lib/active_record/fixtures.rb:519:in `create_fixtures'
./test/cases/../../lib/active_record/fixtures.rb:519:in `each'
./test/cases/../../lib/active_record/fixtures.rb:519:in `create_fixtures'
./test/cases/../../lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
./test/cases/../../lib/active_record/fixtures.rb:517:in `create_fixtures'
./test/cases/../../lib/active_record/connection_adapters/mysql_adapter.rb:252:in `disable_referential_integrity'
./test/cases/../../lib/active_record/fixtures.rb:508:in `create_fixtures'
./test/cases/../../lib/active_record/base.rb:1240:in `silence'
./test/cases/../../lib/active_record/fixtures.rb:507:in `create_fixtures'
./test/cases/../../lib/active_record/fixtures.rb:962:in `load_fixtures'
./test/cases/../../lib/active_record/fixtures.rb:928:in `setup_fixtures'
./test/cases/../../lib/../../activesupport/lib/active_support/callbacks.rb:173:in `send'
./test/cases/../../lib/../../activesupport/lib/active_support/callbacks.rb:173:in `evaluate_method'
./test/cases/../../lib/../../activesupport/lib/active_support/callbacks.rb:161:in `call'
./test/cases/../../lib/../../activesupport/lib/active_support/callbacks.rb:90:in `run'
./test/cases/../../lib/../../activesupport/lib/active_support/callbacks.rb:90:in `each'
./test/cases/../../lib/../../activesupport/lib/active_support/callbacks.rb:90:in `send'
./test/cases/../../lib/../../activesupport/lib/active_support/callbacks.rb:90:in `run'
./test/cases/../../lib/../../activesupport/lib/active_support/callbacks.rb:272:in `run_callbacks'
./test/cases/../../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:57:in `run'
-
Frederick Cheung
Wow, that obviously didn't happen when I ran the tests. I tried again applying the patch to a clean checkout of rails and it still looks ok (I cleared out the databases used by the unit tests in between).
It obviously doesn't like one of the fixture files I added, but I'm not sure I understand why since they're really quite ordinary. A quick google implies that IndexError: string not matched implies that you tried to use a string like a hash, but I don't understand how that could happen especially as I can't reproduce it
-
Frederick Cheung
I've had a bit of a fiddle and I can reproduce this if i edit jobs.yml (added in this patch) so that the last line reads
magician: id:instead of
magician: id: 3I can see now that that file didn't have a newline at the end, so perhaps I botched things up there a bit ? Does jobs.yml look right ?
-
Frederick Cheung
I think i've fixed the files with no new lines at the end. This should make everything hunky-dory
-
Repository
- State changed from new to resolved
(from [44d214235271cb6d2af1c327d592a3010e1ced3e]) Ensure table names are quoted by the association preloading code.
[#45 state:resolved]
Signed-off-by: Michael Koziarski
-
Michael Koziarski
- State changed from resolved to new
yeah, that was it.
Man that was an awesome error ;)
