ntq_excelsior_engine 1.1.2 → 1.1.4
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 +4 -4
- data/app/controllers/ntq_excelsior_engine/application_controller.rb +7 -0
- data/app/controllers/ntq_excelsior_engine/imports_controller.rb +3 -3
- data/app/interactors/ntq_excelsior_engine/imports/import_lines.rb +3 -2
- data/app/models/ntq_excelsior_engine/import.rb +9 -3
- data/app/models/ntq_excelsior_engine/import_line.rb +5 -1
- data/lib/ntq_excelsior_engine/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 81b083577e259e62967ac8012e2a6bb73821af86b0ba172a44f235eb4920ae47
|
|
4
|
+
data.tar.gz: c870916a076995484e821d920fb9d2ec49b6177278b51225e2c1bc3098ae5068
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8361c52d30e203ba0b7803051a0193a738712b92a633760de719a0c9b10ce85213196f405c4d70f7ad11af3ed9482b90e56e3e0ba6f1f90a1672fe403e92c3f5
|
|
7
|
+
data.tar.gz: 4bc126b2449c9931bad6ad81ddfc7a88edc7249ed69130634e611c882fc39c1361bc7e1866103928238e64de7415008889b4c0e724b9260df5d9998b83b38c7f
|
|
@@ -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
|
-
|
|
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)
|
|
@@ -7,9 +7,15 @@ module NtqExcelsiorEngine
|
|
|
7
7
|
enum state: { pending: 'pending', buffering: 'buffering', buffered: 'buffered', imported: 'imported',
|
|
8
8
|
error: 'error', importing: 'importing', checking: 'checking', checked: 'checked' }
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
if ActiveRecord.version >= Gem::Version.new('7.1')
|
|
11
|
+
serialize :options, coder: YAML, type: Hash
|
|
12
|
+
serialize :headers, coder: YAML, type: Hash
|
|
13
|
+
serialize :stats, coder: YAML, type: Hash
|
|
14
|
+
else
|
|
15
|
+
serialize :options, Hash
|
|
16
|
+
serialize :headers, Hash
|
|
17
|
+
serialize :stats, Hash
|
|
18
|
+
end
|
|
13
19
|
|
|
14
20
|
after_create_commit :process_import!
|
|
15
21
|
|
|
@@ -2,7 +2,11 @@ module NtqExcelsiorEngine
|
|
|
2
2
|
class ImportLine < ApplicationRecord
|
|
3
3
|
self.table_name = "excelsior_import_lines"
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
if ActiveRecord.version >= Gem::Version.new('7.1')
|
|
6
|
+
serialize :line, coder: YAML, type: Hash
|
|
7
|
+
else
|
|
8
|
+
serialize :line, Hash
|
|
9
|
+
end
|
|
6
10
|
|
|
7
11
|
validates :status, inclusion: { in: %w[error success] }, allow_blank: true
|
|
8
12
|
validates :action, inclusion: { in: %w[create update] }, allow_blank: true
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ntq_excelsior_engine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kevin
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rails
|
|
@@ -183,7 +182,6 @@ metadata:
|
|
|
183
182
|
homepage_uri: https://github.com/9troisquarts/ntq-excelsior-engine
|
|
184
183
|
source_code_uri: https://github.com/9troisquarts/ntq-excelsior-engine
|
|
185
184
|
changelog_uri: https://github.com/9troisquarts/ntq-excelsior-engine/CHANGELOG.md
|
|
186
|
-
post_install_message:
|
|
187
185
|
rdoc_options: []
|
|
188
186
|
require_paths:
|
|
189
187
|
- lib
|
|
@@ -198,8 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
198
196
|
- !ruby/object:Gem::Version
|
|
199
197
|
version: '0'
|
|
200
198
|
requirements: []
|
|
201
|
-
rubygems_version: 3.
|
|
202
|
-
signing_key:
|
|
199
|
+
rubygems_version: 3.6.9
|
|
203
200
|
specification_version: 4
|
|
204
201
|
summary: NtqExcelsiorEngine.
|
|
205
202
|
test_files: []
|