initial-test-data 0.6.1 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +14 -0
- data/lib/initial-test-data/initial_test_data.rb +3 -2
- 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: b4fb14f578c4e2c01b28a54d6072b677e1819b87
|
4
|
+
data.tar.gz: bf1a184245e624bc74ae7c7f9c567c6d575c999d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 232b6b0d93893945b85cca9a6e4f741ffeb52bdd24847222276d6cbeef1eb285b033c052a77c391c7d7e50f364787b8f956a6c76419db812cd45ae2c9fae6c6b
|
7
|
+
data.tar.gz: 2fbca9f2f3086fdeba96484cafe49e7996096f71a768a8fb36aa65a396d24f3c73f7b2861e58a2b8e56e3b77f366213aea8062f8639294e822ef8781eb3c8e7b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# CHANGELOG - initial-test-data
|
2
2
|
|
3
|
+
## 0.6.3 (February 28, 2016)
|
4
|
+
|
5
|
+
* Bug fix: Load record ids when `REINIT` is set 0.
|
6
|
+
|
7
|
+
## 0.6.2 (February 28, 2016) yanked
|
8
|
+
|
9
|
+
* Determine by `REINIT` environment variable if reinitialization is required.
|
10
|
+
|
3
11
|
## 0.6.1 (February 28, 2016)
|
4
12
|
|
5
13
|
* Users should require factory_girl patch explicitly.
|
data/README.md
CHANGED
@@ -197,6 +197,20 @@ named `initial_data_record_ids.yml` in the `tmp` directory
|
|
197
197
|
to track the primary key values of registered records.
|
198
198
|
Please do not remove or tamper it.
|
199
199
|
|
200
|
+
### Environment variable `REINIT`
|
201
|
+
|
202
|
+
If you want to enforce the initialization process, add `REINIT=1` before the command:
|
203
|
+
|
204
|
+
```text
|
205
|
+
REINIT=1 bin/rake test
|
206
|
+
```
|
207
|
+
|
208
|
+
When you want to skip it, place `REINIT=0` before the command:
|
209
|
+
|
210
|
+
```text
|
211
|
+
REINIT=0 bin/rake test
|
212
|
+
```
|
213
|
+
|
200
214
|
Example
|
201
215
|
-------
|
202
216
|
|
@@ -20,7 +20,8 @@ module InitialTestData
|
|
20
20
|
|
21
21
|
needs_reinitialization = true
|
22
22
|
record_ids_path = Rails.root.join('tmp', 'initial_data_record_ids.yml')
|
23
|
-
if File.exists?(record_ids_path) &&
|
23
|
+
if File.exists?(record_ids_path) &&
|
24
|
+
(ENV['REINIT'] == '0' || md5_digest == md5_digest_cache)
|
24
25
|
begin
|
25
26
|
RECORD_IDS.merge! YAML.load_file(record_ids_path)
|
26
27
|
needs_reinitialization = false
|
@@ -28,7 +29,7 @@ module InitialTestData
|
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
31
|
-
if needs_reinitialization
|
32
|
+
if ENV['REINIT'] == '1' || (needs_reinitialization && ENV['REINIT'] != '0')
|
32
33
|
SequenceEnumerator.reset
|
33
34
|
RECORD_IDS.clear
|
34
35
|
initialize_data
|