initial-test-data 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/initial-test-data/initial_test_data.rb +10 -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: c6721d973f28cf59c8bf8bc3018f514be62745a2
|
4
|
+
data.tar.gz: 90d123ca554811506d4e7c50abbe99c7d7e3e194
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad2e4f4a141f0211bb45e90ff2e0c065d95a0a702e421a483931f79e425f5aa0a861f2145de0e14dd8db383cd982fe09b9a114eec9bdb8e928bac62cff2f4e6f
|
7
|
+
data.tar.gz: 42c25ea8331b0a6b78c0331a4dba569412026ed9af2e18b1af8e291689224a5e28ee1a556c7430d15ea79d029001ef67e5aaf8b0036378cdd5c3e5cfb2a558ad
|
data/CHANGELOG.md
CHANGED
@@ -6,7 +6,7 @@ class InitialTestData
|
|
6
6
|
|
7
7
|
class << self
|
8
8
|
def load(*args)
|
9
|
-
@
|
9
|
+
@options = args.extract_options!
|
10
10
|
@dir = args[0] || 'test'
|
11
11
|
|
12
12
|
klass = define_class
|
@@ -49,7 +49,15 @@ class InitialTestData
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def initialize_data
|
52
|
-
|
52
|
+
strategy_options = @options.slice(:only, :except)
|
53
|
+
unless strategy_options.has_key?(:only)
|
54
|
+
strategy_options[:except] ||= []
|
55
|
+
unless strategy_options[:except].include?(DIGEST_TABLE_NAME)
|
56
|
+
strategy_options[:except] << DIGEST_TABLE_NAME
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
DatabaseCleaner.strategy = :truncation, strategy_options
|
53
61
|
DatabaseCleaner.clean
|
54
62
|
|
55
63
|
yaml_path = Rails.root.join(@dir, 'initial_data', '_index.yml')
|