aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_record_basics.textile
diff options
context:
space:
mode:
authorFranck Verrot <linuxshell@gmail.com>2010-04-08 18:05:12 +0200
committerJosé Valim <jose.valim@gmail.com>2010-05-16 18:04:31 +0200
commit621ee373cbd7f88b0c28d45259b9dc9c43d04e44 (patch)
treef88fb77d85605eb5db222046f436f5b47075b5e0 /railties/guides/source/active_record_basics.textile
parentd61dbce48221b270a5e2d1d35520873c5fdd9677 (diff)
downloadrails-621ee373cbd7f88b0c28d45259b9dc9c43d04e44.tar.gz
rails-621ee373cbd7f88b0c28d45259b9dc9c43d04e44.tar.bz2
rails-621ee373cbd7f88b0c28d45259b9dc9c43d04e44.zip
I have updated the documentation according to ticket #4263 about fixtures and set_fixture_class
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties/guides/source/active_record_basics.textile')
-rw-r--r--railties/guides/source/active_record_basics.textile10
1 files changed, 9 insertions, 1 deletions
diff --git a/railties/guides/source/active_record_basics.textile b/railties/guides/source/active_record_basics.textile
index 226f1b134b..d81e461e63 100644
--- a/railties/guides/source/active_record_basics.textile
+++ b/railties/guides/source/active_record_basics.textile
@@ -104,6 +104,14 @@ class Product < ActiveRecord::Base
set_table_name "PRODUCT"
end
</ruby>
+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:
+<ruby>
+class FunnyJoke < ActiveSupport::TestCase
+ set_fixture_class :funny_jokes => 'Joke'
+ fixtures :funny_jokes
+ ...
+end
+</ruby>
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:
<ruby>
@@ -201,4 +209,4 @@ Active Record callbacks allow you to attach code to certain events in the life-c
h3. Migrations
-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 \ No newline at end of file
+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