ntq_excelsior_engine 0.4.1 → 0.4.3

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: 490d17d4df982da7fedcf2f3de2da594d6b1838a6a3b26eacf29c9f00adafea3
4
- data.tar.gz: c5a19583c142c7f572d190e1a1923311c73800cf3814fdc960a91c0caa39a6ae
3
+ metadata.gz: 79db4dc538577b30956cd4d4a21876615e3b8479be890c7b40749f8da2c93003
4
+ data.tar.gz: 42afde5cc58e02d6ae8d1afe592b6f8f31c6547982917b3a7a38e01816c7635c
5
5
  SHA512:
6
- metadata.gz: df158fb788938786aaa6357cbd93faf7b274d419c15728316a659ec57c7dcbef15c9531c1eb3bd8978b0a0532fc347b621a439304f10d4b0f683b9e8b58c1e89
7
- data.tar.gz: d2ca1fb2432d78535104bd8e118aa767899274f5172ec0039aacb47228cfe6ddacb278c52865c95a903c3f5571d2dab8b3116739b3835b8db352d854c469f554
6
+ metadata.gz: ae6b64a326bce7e2407fd53d4430c216cacc37fe94a1ac434bdf2cae9d70e995810767400cf5444053e89c72322018acaf082a797f30b18d257f4def2749fde5
7
+ data.tar.gz: 1c16c720fadbd0540f536de749fe2352dea233bc8da88f12c09d5de234c241dad0bc59786a0e12a4a80bd510ad6007e8226875025ea1a8011b5d1cba8b381709
@@ -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
@@ -2,6 +2,8 @@ module NtqExcelsiorEngine
2
2
  class Import < ::ApplicationRecord
3
3
 
4
4
  self.table_name = "excelsior_imports"
5
+
6
+ attr_accessor :async
5
7
 
6
8
  enum state: { pending: 'pending', buffering: 'buffering', buffered: 'buffered', imported: 'imported', error: 'error', importing: 'importing', checking: 'checking', checked: 'checked' }
7
9
 
@@ -34,7 +36,7 @@ module NtqExcelsiorEngine
34
36
  end
35
37
 
36
38
  def process_import!(actions: NtqExcelsiorEngine.actions_on_create.map(&:to_s))
37
- if NtqExcelsiorEngine.async
39
+ if async || (async.nil? && NtqExcelsiorEngine.async)
38
40
  job_id = NtqExcelsiorEngine::ProcessImportJob.perform_async(id, actions.join(','))
39
41
  p "ASYNC #{job_id}"
40
42
  end
@@ -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.1"
2
+ VERSION = "0.4.3"
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,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ntq_excelsior_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-12 00:00:00.000000000 Z
11
+ date: 2023-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "<"
18
- - !ruby/object:Gem::Version
19
- version: '8'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: '6'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '8'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "<"
28
- - !ruby/object:Gem::Version
29
- version: '8'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: '6'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '8'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: jbuilder
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -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
@@ -176,7 +177,7 @@ metadata:
176
177
  homepage_uri: https://github.com/9troisquarts/ntq-excelsior-engine
177
178
  source_code_uri: https://github.com/9troisquarts/ntq-excelsior-engine
178
179
  changelog_uri: https://github.com/9troisquarts/ntq-excelsior-engine/CHANGELOG.md
179
- post_install_message:
180
+ post_install_message:
180
181
  rdoc_options: []
181
182
  require_paths:
182
183
  - lib
@@ -191,8 +192,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
192
  - !ruby/object:Gem::Version
192
193
  version: '0'
193
194
  requirements: []
194
- rubygems_version: 3.3.7
195
- signing_key:
195
+ rubygems_version: 3.0.3.1
196
+ signing_key:
196
197
  specification_version: 4
197
198
  summary: NtqExcelsiorEngine.
198
199
  test_files: []