data_seeder 1.0.5 → 1.0.6

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: 239e84c1f55501280cc7d421ba065c052734ceff
4
- data.tar.gz: 9419b858ae7f39a69d4033f8e8ed7263a5da8f0f
3
+ metadata.gz: 999dc4a6f140a6f98ec1607e249e09714f832195
4
+ data.tar.gz: c6fd34c9f01d87c32c8d9da633fc0a4b90b4b7de
5
5
  SHA512:
6
- metadata.gz: 29b9e829c052cbb244246caf770dd52fb439ed3af036f99355ba5bfcc1b56842ec0d2fd83c48b239fdbc45b03edc2547c9478d5b47ba4a0935b4bb7e0a651c30
7
- data.tar.gz: f2086ba32bd57d04e7fe1ba1d18100abe22594fee1d3240af6f3ec98ade5cb96d6386ac9ea11d0b2a8c17c09ee103c279704075c5691e6d0f5d84630290877cc
6
+ metadata.gz: 4cf23450ba99b756200600a934b97b31ab5ab2ed61e81a29e08af23e009df5036187c845b313a01b4f0f475dde0926b9c89d2c18ec764758b04669db72296f64
7
+ data.tar.gz: d12636d3d7c86ad536232ec8c74593c195c09dc8a9d23ba35074abd3e5a55dcaaa69028a119f0cf845ee6e748328264cca1320b1c9354dce2922a363ac88e520
data/README.md CHANGED
@@ -174,6 +174,10 @@ Defines the ActiveRecord Class if it can't be inferred from the seed file.
174
174
 
175
175
  Proc used for converting a line to attributes.
176
176
 
177
+ #### open_options
178
+
179
+ Options passed to File.open to allow encoding values, etc. (ex: open_options: {encoding: 'ISO-8859-1:UTF-8'})
180
+
177
181
  #### postprocess
178
182
 
179
183
  Modify the attributes from the seed file before applying them to the model.
@@ -61,7 +61,7 @@ module DataSeeder
61
61
  return false if depends && !self.class.processed?(depends)
62
62
  DataSeeder.config.logger.info { "Loading #{path}" }
63
63
  DataSeeder.config.log_indent do
64
- File.open(path, 'r') do |io|
64
+ File.open(path, 'r', config[:open_options]) do |io|
65
65
  loader.process(io)
66
66
  end
67
67
  self.sha256 = new_sha256
@@ -1,3 +1,3 @@
1
1
  module DataSeeder
2
- VERSION = '1.0.5'
2
+ VERSION = '1.0.6'
3
3
  end