ntq_excelsior_engine 0.3.2 → 0.4.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
  SHA256:
3
- metadata.gz: 5079df1832c81393d48a170a45bf2af1d72ef5eb30115574008146f58e55a4ca
4
- data.tar.gz: 4d3d56ea2e1a0fb9cbe7595be527ee02fc1b6234b2da97ca8a1a09c177c042b2
3
+ metadata.gz: 490d17d4df982da7fedcf2f3de2da594d6b1838a6a3b26eacf29c9f00adafea3
4
+ data.tar.gz: c5a19583c142c7f572d190e1a1923311c73800cf3814fdc960a91c0caa39a6ae
5
5
  SHA512:
6
- metadata.gz: e1480ec6ea4d4d0baae5bd126f5e5d5d5cae9035ea733e1cb93c93a20c8d41f521103af4921b6e7e22a258ba251c455e1e4e8d0783d457020d0c620a207b93cc
7
- data.tar.gz: df1616df6ad1a7bac29f84e3f7032e7f819830ba42a0b727e2f1f5d6b32c318f26375a280f79cc5160d7d35e5735c04e9bbb3ab030ccc5191a9e15af54476206
6
+ metadata.gz: df158fb788938786aaa6357cbd93faf7b274d419c15728316a659ec57c7dcbef15c9531c1eb3bd8978b0a0532fc347b621a439304f10d4b0f683b9e8b58c1e89
7
+ data.tar.gz: d2ca1fb2432d78535104bd8e118aa767899274f5172ec0039aacb47228cfe6ddacb278c52865c95a903c3f5571d2dab8b3116739b3835b8db352d854c469f554
@@ -3,7 +3,7 @@ module NtqExcelsiorEngine
3
3
  include Interactor
4
4
 
5
5
  around do |interactor|
6
- if context.actions && context.actions.include?("import") && context.import && !context.import.error? && context.importer && context.import.import_lines.any?
6
+ if context.actions && context.actions.include?("import") && context.import && (!NtqExcelsiorEngine.skip_import_on_errors || !context.import.error?) && context.importer && context.import.import_lines.any?
7
7
  interactor.call
8
8
  end
9
9
  end
@@ -13,7 +13,7 @@ module NtqExcelsiorEngine
13
13
  importer = context.importer.new
14
14
  begin
15
15
  import.update(state: 'importing')
16
- import.import_lines.each do |line|
16
+ import.import_lines.find_each(batch_size: 1000) do |line|
17
17
  result = importer.import_line(line.line, save: true)
18
18
  line.update(status: result[:status], line_errors: result[:errors], action: result[:action])
19
19
  end
@@ -14,4 +14,8 @@ NtqExcelsiorEngine.setup do |config|
14
14
  # config.actions_on_create = [:load, :check, :import]
15
15
  # config.action_cable = false
16
16
 
17
+ # Dont import lines if file have errors
18
+ # Set this to false for import even if errors are present
19
+ # skip_import_on_errors = true
20
+
17
21
  end
@@ -1,3 +1,3 @@
1
1
  module NtqExcelsiorEngine
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -23,6 +23,9 @@ module NtqExcelsiorEngine
23
23
  mattr_accessor :debug
24
24
  @@debug = false
25
25
 
26
+ mattr_accessor :skip_import_on_errors
27
+ @@skip_import_on_errors = true
28
+
26
29
  def self.setup
27
30
  yield self
28
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ntq_excelsior_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-03 00:00:00.000000000 Z
11
+ date: 2023-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails