colonization 0.3 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +43 -8
- data/lib/colonization/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8568fe85422ca7740126206b7df754c16391c5cb
|
4
|
+
data.tar.gz: f89833d1ca93b44256b46bd3e4e0343dcdd354c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66e0cd1d5896ca41c8e4c300db442cb2c2ed45c8a259af87ed238c409230acd946e81940d38349ac008ffbe7db79e745b8f6d657539f3644a93cdb5e2418add2
|
7
|
+
data.tar.gz: 0805aa28b92176fc9ef77cc9a9d1579a7b72d7eddbca410aa5a3c3717ad88200c59c35a12c58fe87f5025916e50dfc81608c6ccf704339c8bcd481789afdbb38
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Colonization
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Gem for development database populating. Data seeding regarding to your models fields, their types and validations. It is in development now - only presence and acceptance validations currently supported.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,15 +20,52 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
Add then following to seeds.rb file:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
Colonization::Ship.new.colonize
|
27
|
+
```
|
28
|
+
That's all!
|
29
|
+
|
30
|
+
## Customization
|
31
|
+
|
32
|
+
Add colonization.rb file to your initializers:
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
Colonization.configure do |config|
|
36
|
+
config.something = :something
|
37
|
+
config.seed_type = :default
|
38
|
+
config.seed_index = 4
|
39
|
+
config.count_of_instances_to_seed = 10
|
40
|
+
config.clear_table = true
|
41
|
+
end
|
42
|
+
```
|
43
|
+
|
44
|
+
List of currently allowed configurations:
|
45
|
+
|
46
|
+
seed_type:
|
47
|
+
|
48
|
+
currently 2 seed strategies are supported - :fixed and :default. Fixed strategy seeding fixed count of
|
49
|
+
instances(user will be able to customize this for each model, it is in development now), by default it is 100. Default strategy populates database according to other configuration setting - :seed_index. By this strategy count of model instances will increase by geometric progression(from parent models to dependent), by default - 3.
|
50
|
+
|
51
|
+
seed_index:
|
52
|
+
by default: 3
|
53
|
+
|
54
|
+
index according to model instances count increase(from parent model to child). E.g. Client has_many orders. With seed_index = 3 Client will have 100 instances, Order - up to 300
|
55
|
+
It is used only by default seed strategy
|
56
|
+
|
57
|
+
count_of_instances_to_seed:
|
58
|
+
by_default: 100
|
59
|
+
|
60
|
+
Used by both strategies. For fixed strategy it means - accurate number of instances to create, for default strategy - instances count for top level model
|
26
61
|
|
27
|
-
|
62
|
+
clear_table:
|
63
|
+
by_default: true
|
28
64
|
|
29
|
-
|
65
|
+
Clear or not table before seeding
|
30
66
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
67
|
|
33
68
|
## Contributing
|
34
69
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
70
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/dongan2010/colonization.
|
36
71
|
|
data/lib/colonization/version.rb
CHANGED