This project is archived and is in readonly mode.
Unit test fails when using non-standard table names
Reported by ohforf | March 24th, 2010 @ 08:52 PM | in 3.0.2
Using set_table_name to set a custom table name causes unit tests to fail:
1) Error: test_myotherclass(MyotherclassTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such
table: myrecords: DELETE FROM "myrecords" WHERE 1=1
Of course there is no such table, since I did a “set_table_name 'my_fancy_tablename'” in class Myrecord.
This error has been reported in tickets #389 and #307. These tickets have been marked as spam.
The author of ticket #389 writes “patch included”, however I'm unable to view this patch.
https://rails.lighthouseapp.com/projects/8994/tickets/307-fixturecl...
https://rails.lighthouseapp.com/projects/8994/tickets/389-incorrect...
Comments and changes to this ticket
-
ohforf March 25th, 2010 @ 04:21 PM
- Tag changed from activerecord set_table_name test to activerecord fixtures set_table_name set_fixture_class
You have to explicitly call the undocumented function set_fixture_class in the test helper to make the fixtures work again:
set_fixture_class :pears => "Fruit::Pear"Maybe this should be documented in the set_table_name function.
-
ohforf March 25th, 2010 @ 04:21 PM
- Tag changed from activerecord fixtures set_table_name set_fixture_class to activerecord set_table_name test
- Title changed from Unit test fail when using non-standard table names to Unit test fails when using non-standard table names
-
Yehuda Katz (wycats) March 27th, 2010 @ 07:38 AM
- State changed from new to incomplete
- Milestone cleared.
-
Yehuda Katz (wycats) March 27th, 2010 @ 07:38 AM
- no changes were found...
-
Cesario April 8th, 2010 @ 05:07 PM
I tried to update the documentation with this patch. Tell me if this is enough.
-
Dan Pickett May 9th, 2010 @ 06:26 PM
- Tag changed from activerecord set_table_name test to activerecord set_table_name test, bugmash
-
Rizwan Reza May 16th, 2010 @ 05:09 PM
- Tag changed from activerecord set_table_name test, bugmash to activerecord set_table_name test
- State changed from incomplete to resolved
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>