mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
- Make example code consistent for better understanding. [ci skip]
This commit is contained in:
parent
314ab7b14d
commit
4fd571abe2
1 changed files with 5 additions and 5 deletions
|
@ -173,18 +173,18 @@ name that should be used:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class Product < ActiveRecord::Base
|
class Product < ActiveRecord::Base
|
||||||
self.table_name = "PRODUCT"
|
self.table_name = "my_products"
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
If you do so, you will have to define manually the class name that is hosting
|
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
|
the fixtures (my_products.yml) using the `set_fixture_class` method in your test
|
||||||
definition:
|
definition:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class FunnyJoke < ActiveSupport::TestCase
|
class ProductTest < ActiveSupport::TestCase
|
||||||
set_fixture_class funny_jokes: Joke
|
set_fixture_class my_products: Product
|
||||||
fixtures :funny_jokes
|
fixtures :my_products
|
||||||
...
|
...
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue