mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Adding a tip in the guides about possible database permission problems on
loading fixtures to the database. Reference #17542
This commit is contained in:
parent
8e52954349
commit
6d59473b48
1 changed files with 2 additions and 0 deletions
|
@ -122,6 +122,8 @@ Rails by default automatically loads all fixtures from the `test/fixtures` folde
|
|||
* Load the fixture data into the table
|
||||
* Dump the fixture data into a variable in case you want to access it directly
|
||||
|
||||
TIP: In order to remove existing data from the database, Rails tries to disable referential integrity triggers (like foreign keys and check constraints). If you are getting annoying permission errors on running tests, make sure the database user has privilege to disable these triggers in testing environment. (In PostgreSQL, just superusers can disable all triggers. Read more about PostgreSQL permissions [here](http://blog.endpoint.com/2012/10/postgres-system-triggers-error.html))
|
||||
|
||||
#### Fixtures are Active Record objects
|
||||
|
||||
Fixtures are instances of Active Record. As mentioned in point #3 above, you can access the object directly because it is automatically setup as a local variable of the test case. For example:
|
||||
|
|
Loading…
Reference in a new issue