Skip to content

Commit 25ca9f5

Browse files
authored
Update README.md
Fixes examples syntax
1 parent c4d02ae commit 25ca9f5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ The truncation and deletion strategies may accept the following options:
5151

5252
```ruby
5353
# Only truncate the "users" table.
54-
DatabaseCleaner[:active_record].strategy = :truncation, only: ["users"]
54+
DatabaseCleaner[:active_record].strategy = DatabaseCleaner::ActiveRecord::Truncation.new(only: ["users"])
5555

5656
# Delete all tables except the "users" table.
57-
DatabaseCleaner[:active_record].strategy = :deletion, except: ["users"]
57+
DatabaseCleaner[:active_record].strategy = DatabaseCleaner::ActiveRecord::Deletion.new(except: ["users"])
5858
```
5959

6060
* `:pre_count` - When set to `true` this will check each table for existing rows before truncating or deleting it. This can speed up test suites when many of the tables are never populated. Defaults to `false`. (Also, see the section on [What strategy is fastest?](#what-strategy-is-fastest))

0 commit comments

Comments
 (0)