data_seeder 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e24f096a1fd9c290b8e6046ae8d2a51eedb102da
4
- data.tar.gz: 5d96f04e6a4fae47c640330a6a15c4f68a05a8a9
3
+ metadata.gz: b92ca5944c206044ac760c64b7608131aa5c45b8
4
+ data.tar.gz: 3cbe704d87ecffc3feef1ce522a2d4b330508ddf
5
5
  SHA512:
6
- metadata.gz: 3b2de1af354cb2b5a0977b97f47dd8e3d22f127e777c3cdbdcd0a5f9a81ae6b118f1aecd29647f57a21d81ade2ac5ec5d5a83b069508846c5dea28a9d8cd3324
7
- data.tar.gz: 72899aa6169debf7eeac35ae8d454c4a0d3befb1297a4ba73ff12935c77c92aa59210db667993a607d2c997708469afa481c7be71c39d9f7cf17827c2c9435ba
6
+ metadata.gz: e7a2df29175105395e24e038194e20a6df9fab7ad0d220742324048bc43bbc5ed53bff5cef33a6d645eeba2b0cb7040389c117979091357415f09a500f94f8b9
7
+ data.tar.gz: a452884b14ce9485ac9028cd66214ab96c11e5044a04ed7982b93e8ac23307c988375fe65b3c300a3fc0fd63310975356a69e214a9dcc02299ee213fd503c60f
@@ -50,6 +50,7 @@ module DataSeeder
50
50
  DataSeeder.config.logger.warn "Warning: No loader for #{path}"
51
51
  return true
52
52
  end
53
+ # This is deprecated. Use instance method instead so seeds can be manually loaded
53
54
  if loader_klass.respond_to?(:default_config)
54
55
  config = loader_klass.default_config.merge(config)
55
56
  end
@@ -6,16 +6,19 @@ module DataSeeder
6
6
 
7
7
  def initialize(config)
8
8
  @seeder_config = DataSeeder.config
9
- @config = config
9
+ @config = default_config.merge(config)
10
10
  @key_attribute = config[:key_attribute] || :id
11
11
  @klass = config[:klass]
12
12
  @path = config[:path]
13
13
  @path_minus_ext = config[:path_minus_ext]
14
- # Default purge to true if unspecified
15
- @config[:purge] = true unless config.has_key?(:purge)
16
14
  @old_ids = Set.new
17
15
  end
18
16
 
17
+ # Override with config defaults
18
+ def default_config
19
+ { purge: true }
20
+ end
21
+
19
22
  def logger
20
23
  @seeder_config.logger
21
24
  end
@@ -1,3 +1,3 @@
1
1
  module DataSeeder
2
- VERSION = "1.0.0"
2
+ VERSION = '1.0.1'
3
3
  end