0.2.0
Version 0.2.0
New Features
Polymorphic Association
-
You can now add a polymorphic association to your seedie.yml file:
belongs_to: commentable: polymorphic: post # or [post, article] for multiple options strategy: random
Automatic Polymorphic Association Generator
-
When you run
rails g seedie:install, it'll also generate the necessary polymorphic associations.
Custom Value Attributes with Validations
-
Replaced custom_attr_value with a simplified value key:
Before:
some_attribute: custom_attr_value: values: [1,2,3] pick_strategy: random
After:
some_attribute: values: [1,2,3] # or value (in which case pick_strategy is not required) options: pick_strategy: random
Custom Value Generator
-
Upon invoking
rails g seedie:install, the generator will also add custom values.
Inclusion of Non-polymorphic _type Columns
-
Earlier, columns with
_typewere skipped during seedie.yml generation, causing some attributes to be overlooked.class User < ApplicationRecord enum role_type: { admin: 0, user: 1 } end
We've resolved this, now only columns related to polymorphic foreign_types are excluded.
Range Inclusions
-
Define ranges using the start and end keys:
score: values: start: 0 end: 100 options: { pick_strategy: sequential }
This configuration will generate sequential numbers between 0 and 100.