You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: railties/guides/source/active_record_basics.textile
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,14 @@ class Product < ActiveRecord::Base
104
104
set_table_name "PRODUCT"
105
105
end
106
106
</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>
107
115
108
116
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:
109
117
<ruby>
@@ -201,4 +209,4 @@ Active Record callbacks allow you to attach code to certain events in the life-c
201
209
202
210
h3. Migrations
203
211
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