Skip to content

Commit 621ee37

Browse files
franckverrotjosevalim
authored andcommitted
I have updated the documentation according to ticket rails#4263 about fixtures and set_fixture_class
Signed-off-by: José Valim <[email protected]>
1 parent d61dbce commit 621ee37

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

railties/guides/source/active_record_basics.textile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ class Product < ActiveRecord::Base
104104
set_table_name "PRODUCT"
105105
end
106106
</ruby>
107+
If you do so, you will have to define manually the class name that is hosting the fixtures (class_name.yml) using the +set_fixture_class+ method in your test definition:
108+
<ruby>
109+
class FunnyJoke < ActiveSupport::TestCase
110+
set_fixture_class :funny_jokes => 'Joke'
111+
fixtures :funny_jokes
112+
...
113+
end
114+
</ruby>
107115

108116
It's also possible to override the column that should be used as the table's primary key. Use the +ActiveRecord::Base.set_primary_key+ method for that:
109117
<ruby>
@@ -201,4 +209,4 @@ Active Record callbacks allow you to attach code to certain events in the life-c
201209

202210
h3. Migrations
203211

204-
Rails provides a domain-specific language for managing a database schema called migrations. Migrations are stored in files which are executed against any database that Active Record support using rake. Rails keeps track of which files have been committed to the database and provides rollback features. You can learn more about migrations in the "Active Record Migrations guide":migrations.html
212+
Rails provides a domain-specific language for managing a database schema called migrations. Migrations are stored in files which are executed against any database that Active Record support using rake. Rails keeps track of which files have been committed to the database and provides rollback features. You can learn more about migrations in the "Active Record Migrations guide":migrations.html

0 commit comments

Comments
 (0)