ntq_excelsior_engine 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: adc057b1e2e3be1d8c935f86ae233f0883d0b088ee62bf8ae57254295807cf6b
4
- data.tar.gz: 7119a39155ed904925a3428294b82553d7154521fc9db7fe6d5e191cf344bc12
3
+ metadata.gz: 7a203d257161eea84e4a05f2623d61e809f023a79049f344845d743a1bb67e95
4
+ data.tar.gz: c3851c059bb40ad5df9264046f85f35712494f0e9e1cb1bc107d8e6332eac615
5
5
  SHA512:
6
- metadata.gz: 3b0bd03dfed29c4d1bada5c95dea27df727259baa9750b25f8b89a4ddb4598f970aa92844fd88b804ed8a456ec0040ef307824f743d382f84163cd0ec1505c0a
7
- data.tar.gz: e8395d599387614ae95a78ab8f74133d76779303dde776ca450741f2d108d41a1c68de42702ac7edabbeba475d3d6c1a84c461abd014e117853e7a8a3f71b2ca
6
+ metadata.gz: cd5d786244808e8735aaac4448de39ce94e6665bc0daa34c94f186e8aca23c4465d28d59f95c3d26fef957ea10d232f2492488d947307d36a954464ad92b8fbc
7
+ data.tar.gz: 91d2b191e61b7d6f6b986abfd053c575e1eaec7e996c7cdfc78b2bc3cc3a6b3346c0877a6fab67be55f2daee1c30abe5816a609793ec6140fcb7bd01ee767f98
@@ -1,4 +1,11 @@
1
1
  module NtqExcelsiorEngine
2
2
  class ApplicationController < ::ApplicationController
3
+ before_action :store_request
4
+
5
+ def store_request
6
+ return unless current_user
7
+
8
+ NtqExcelsiorEngine::Request.store[:whoimportit] = current_user
9
+ end
3
10
  end
4
11
  end
@@ -31,7 +31,7 @@ module NtqExcelsiorEngine
31
31
 
32
32
  def create
33
33
  @import_file = ::NtqExcelsiorEngine::Import.new import_type: params[:type]
34
- @import_file.created_by = NtqExcelsiorEngine.request.whoimportit
34
+ @import_file.created_by = NtqExcelsiorEngine.request.whoimportit.id if NtqExcelsiorEngine.request.whoimportit
35
35
  @import_file.file = file_params
36
36
  yield(@import_file) if block_given?
37
37
  @import_file.inspect
@@ -55,9 +55,9 @@ module NtqExcelsiorEngine
55
55
  end
56
56
  render :status, layout: false
57
57
  end
58
-
58
+
59
59
  private
60
-
60
+
61
61
  def ensure_valid_importer_type!
62
62
  valid_types = NtqExcelsiorEngine.importers.keys.map(&:to_s)
63
63
  return render json: {}, status: 422 unless valid_types.include?(params[:type]) || params[:type].blank?
@@ -13,8 +13,9 @@ module NtqExcelsiorEngine
13
13
  importer = context.importer.new
14
14
  importer.options ||= {}
15
15
  importer.options.merge!({
16
- import_id: import.id,
17
- })
16
+ import_id: import.id,
17
+ creator: import.created_by
18
+ })
18
19
  begin
19
20
  import.update(state: 'importing')
20
21
  importer.class.before.call(importer.context, importer.options) if importer.class.before.is_a?(Proc)
@@ -1,3 +1,3 @@
1
1
  module NtqExcelsiorEngine
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  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: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-23 00:00:00.000000000 Z
11
+ date: 2024-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails