importo 3.0.12 → 3.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/tables/importo/imports_table.rb +6 -1
- data/lib/importo/test_helpers.rb +17 -0
- data/lib/importo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd4b3db91de0cb6d968bd01d4bf0bad047d780c4107b6c93516c24167b57c0de
|
4
|
+
data.tar.gz: 85acd9762cb804e328bb74f4d7a89f903e63815b624510d011d065cb6fdf722d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4776bb7d6af56b198ad1e2786b9f77fba192e4d75717e113924634fc67278afc30505b2ce180ee77c5fb327e1833c23fd2f48c4c05f78e6a6ebb772a3d8cc3b3
|
7
|
+
data.tar.gz: 76f821df633edfb58fad53d99229d26891d349f2cc7bc99421afc36f24a72f22ba1fa4863bf11bd6838b6628b5013540c38d21de519f29d60ec306803292bcf1
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
if defined? ActionTable
|
4
|
+
class Importo::ImportsTable < ActionTable::ActionTable
|
4
5
|
model Importo::Import
|
5
6
|
|
6
7
|
column(:created_at, html_value: proc { |import| l(import.created_at.in_time_zone(Time.zone), format: :short).to_s })
|
@@ -33,3 +34,7 @@ class Importo::ImportsTable < ActionTable::ActionTable
|
|
33
34
|
@scope
|
34
35
|
end
|
35
36
|
end
|
37
|
+
else
|
38
|
+
class Importo::ImportsTable
|
39
|
+
end
|
40
|
+
end
|
data/lib/importo/test_helpers.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "axlsx"
|
4
|
+
require "roo/excelx"
|
4
5
|
|
5
6
|
module Importo
|
6
7
|
module TestHelpers
|
@@ -15,5 +16,21 @@ module Importo
|
|
15
16
|
|
16
17
|
xls.to_stream
|
17
18
|
end
|
19
|
+
|
20
|
+
def sample_sheet(kind, locale: I18n.locale)
|
21
|
+
excel = Importo::Import.new(kind: kind, locale: locale).importer.sample_file
|
22
|
+
|
23
|
+
Roo::Excelx.new(excel.set_encoding("BINARY"))
|
24
|
+
end
|
25
|
+
|
26
|
+
def import_sheet(kind, sheet, filename: 'import.xlsx', locale: I18n.locale, owner: users(:admin))
|
27
|
+
import = Importo::Import.new(kind: kind, locale: locale, importo_ownable: owner)
|
28
|
+
|
29
|
+
import.original.attach(io: sheet, filename: filename, content_type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", identify: false)
|
30
|
+
import.save!
|
31
|
+
|
32
|
+
ImportService.perform(import: import)
|
33
|
+
import
|
34
|
+
end
|
18
35
|
end
|
19
36
|
end
|
data/lib/importo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: importo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andre Meij
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-04-
|
12
|
+
date: 2024-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: caxlsx
|