ntq_excelsior_engine 0.4.2 → 0.4.4

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: 13a03024396714dbe927960c5444dc3c6e494f58b1cc536e76149011f3fb808e
4
- data.tar.gz: 80abc920a5774e739fb8fe305a2beabc89bb10d1769d49de0fbd3e03164010e0
3
+ metadata.gz: 9f31f5cb4b6498540cb0a9742e4539b6e8c259c2bbf1076d6eb3748a0579c562
4
+ data.tar.gz: ef28c9579f1607e09a0325344050deb3bf7112b8744cbb56a605e2eaf7177b2d
5
5
  SHA512:
6
- metadata.gz: 3e271e7251b5bfb9bcb0fbe33478f5913b4853ee4be499cefff0b47ea65462c6c8b4d5f458e1fa9af88df98583a6595fda7323d7ca7383fe65a5fab1df9a82bf
7
- data.tar.gz: e3a67f73dc0b58f5c64641844b582373068e5fdd151f15f12041263d0c90075b6e4675db060bc51619ea53c3b552ccb4fe76ba421eb05982f0adbd887892a038
6
+ metadata.gz: 8fbbfc93950e6cdb9532454c0ef93a3ab18a53f2add210c7f702fcd4d4747d4300307bb4ef1b8dc776a2650dfd54677e67d4bca6a9c6a1c620c0b81a770357fd
7
+ data.tar.gz: 98bdcef0a3993eacf6c0d01e2798379492c1abbe3faa874becdc674c5adb26dbc3fe4ee3fa094caf3e113d20fc25996e0e2c632a331491b1449fa93a92d30abc
@@ -32,6 +32,7 @@ module NtqExcelsiorEngine
32
32
 
33
33
  def create
34
34
  @import_file = ::NtqExcelsiorEngine::Import.new import_type: params[:type]
35
+ @import_file.created_by = NtqExcelsiorEngine.request.whoimportit
35
36
  @import_file.file = file_params
36
37
  yield(@import_file) if block_given?
37
38
  @import_file.inspect
@@ -18,7 +18,7 @@ module NtqExcelsiorEngine
18
18
  line.update(status: result[:status], line_errors: result[:errors], action: result[:action])
19
19
  end
20
20
  sleep 2 if NtqExcelsiorEngine.debug
21
- import.update(state: import.import_lines.in_error.any? ? 'error' : 'checked')
21
+ import.update(state: import.import_lines.in_error.any? && !NtqExcelsiorEngine.skip_import_on_errors ? 'error' : 'checked')
22
22
  rescue => e
23
23
  p e.inspect
24
24
  Appsignal.send_error(e)
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "request_store"
4
+
5
+ module NtqExcelsiorEngine
6
+ module Request
7
+ module_function
8
+
9
+ def whoimportit=(value)
10
+ store[:whoimportit] = value
11
+ end
12
+
13
+ def whoimportit
14
+ who = store[:whoimportit]
15
+ who.respond_to?(:call) ? who.call : who
16
+ end
17
+
18
+ def store
19
+ RequestStore.store[:ntq_excelsior_engine] ||= {
20
+ whoimportit: nil
21
+ }
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module NtqExcelsiorEngine
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.4"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require "ntq_excelsior_engine/version"
2
2
  require "ntq_excelsior_engine/engine"
3
+ require "ntq_excelsior_engine/request"
3
4
 
4
5
  module NtqExcelsiorEngine
5
6
  mattr_accessor :import_active
@@ -26,6 +27,9 @@ module NtqExcelsiorEngine
26
27
  mattr_accessor :skip_import_on_errors
27
28
  @@skip_import_on_errors = true
28
29
 
30
+ mattr_accessor :request
31
+ @@request = NtqExcelsiorEngine::Request
32
+
29
33
  def self.setup
30
34
  yield self
31
35
  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.4.2
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-19 00:00:00.000000000 Z
11
+ date: 2023-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -167,6 +167,7 @@ files:
167
167
  - lib/generators/templates/ntq_excelsior_engine.rb
168
168
  - lib/ntq_excelsior_engine.rb
169
169
  - lib/ntq_excelsior_engine/engine.rb
170
+ - lib/ntq_excelsior_engine/request.rb
170
171
  - lib/ntq_excelsior_engine/version.rb
171
172
  - lib/tasks/ntq_excelsior_engine_tasks.rake
172
173
  homepage: https://github.com/9troisquarts/ntq-excelsior-engine