Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that seed files are run in transactions #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,21 @@ Seed files can be huge. To handle large files (over a million rows), try these
* Load a single fixture at a time with the `FILTER` environment variable
* If you don't need Seed Fu's ability to update seed with new data, then you may find that [activerecord-import](https://github.com/zdennis/activerecord-import) is faster

Seed files are run inside transactions
--------------------------------------

If a command raises, all previous database modifications on the current file are rolled back:

```ruby
User.seed do |s|
s.id = 1
s.email = "[email protected]"
end
raise
```

would not create a new user.

Generating seed files
---------------------

Expand Down