README.md in evil-seed-0.5.0 vs README.md in evil-seed-0.6.0
- old
+ new
@@ -50,18 +50,26 @@
config.root('Forum', featured: true) do |root|
# It's possible to remove some associations from dumping with pattern of association path to exclude
#
# Association path is a dot-delimited string of association chain starting from model itself:
# example: "forum.users.questions"
- root.exclude(/\btracking_pixels\b/, 'forum.popular_questions')
+ root.exclude(/\btracking_pixels\b/, 'forum.popular_questions', /\Aforum\.parent\b/)
+ # Include back only certain associations
+ root.include(/\Aforum(\.parent(\.questions(\.answers)?)?)?\z/)
+
# It's possible to limit the number of included into dump has_many and has_one records for every association
# Note that belongs_to records for all not excluded associations are always dumped to keep referential integrity.
root.limit_associations_size(100)
# Or for certain association only
root.limit_associations_size(10, 'forum.questions')
+
+ # Limit the depth of associations to be dumped from the root level
+ # All traverses through has_many, belongs_to, etc are counted
+ # So forum.subforums.subforums.questions.answers will be 5 levels deep
+ root.limit_deep(10)
end
# Everything you can pass to +where+ method will work as constraints:
config.root('User', 'created_at > ?', Time.current.beginning_of_day - 1.day)
@@ -93,9 +101,23 @@
# with encrypted columns.
#
# This will remove the columns even if the model is not a root node and is
# dumped via an association.
config.ignore_columns("Profile", :name)
+
+ # Disable foreign key nullification for records that are not included in the dump
+ # By default, EvilSeed will nullify foreign keys for records that are not included in the dump
+ config.dont_nullify = true
+
+ # Unscope relations to include soft-deleted records etc
+ # This is useful when you want to include all records, including those that are hidden by default
+ # By default, EvilSeed will abide default scope of models
+ config.unscoped = true
+
+ # Verbose mode will print out the progress of the dump to the console along with writing the file
+ # By default, verbose mode is off
+ config.verbose = true
+ config.verbose_sql = true
end
```
### Creating dump