imp_exp 1.0.4 → 1.0.6

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: 7711f6ff4319e484b98519a539cbd23c158ffe8fe02c38dc5d1e99290005a00c
4
- data.tar.gz: e851a1309a55ccd30f61a97a23900c36c28c7e8d52f6c5ec2a1059d301661942
3
+ metadata.gz: 26e8634a3041bbe34e2d8488bc6238dfd44544fa862704ef18fd40f5a0544a97
4
+ data.tar.gz: 16aae84ac54c68d7c14c988f22ea2d19363f2eacb0c6043b7a495980ced72c90
5
5
  SHA512:
6
- metadata.gz: 6f905a7e04c2417a3cd12ae4cda425c336ff0bf2b072b8fd3d4c0e9f7b74b383a912642a5ff604287cdf3532acd4f16108fcd25a184bc5d3d847720c53ae0861
7
- data.tar.gz: ac0b3a963e9ae3ec5576ea8513e0b0c357673cf6af5da4a0d7b7a97f301e218fc77c192043cb6890b6561d0d52d986c5f4f2fdd3f2dd9ca422b21a11118c0d66
6
+ metadata.gz: 062176d6f62d1e9b8043a7e2730499e1e73319a756176e729f86eceec29c1ca13acc86f77928cc8b41f7cad56845d9a5f1fed28b088843694bfd12a19d4d1dbb
7
+ data.tar.gz: 811d80f670688704d2fd839bdf26a43d26281e57b88e19fcd72bc0bd418530fe9daad0a3c50014177ba1b9b26fc3cdfca558c3e86938d55b7d665b56afc8c82d
@@ -87,8 +87,13 @@ module ImpExp
87
87
  def headers_translated
88
88
  (attributes + relations).map do |name, opts = {}|
89
89
  i18n_path = opts[:i18n_path].presence || "#{active_record_class.model_name.i18n_key}.#{name}"
90
- key = "activerecord.attributes.#{i18n_path}"
91
- I18n.t(key, raise: true)
90
+ begin
91
+ I18n.t("activerecord.attributes.#{i18n_path}", raise: true)
92
+ rescue I18n::MissingTranslationData
93
+ raise if opts[:i18n_path].present?
94
+
95
+ I18n.t("attributes.#{name}", raise: true)
96
+ end
92
97
  end
93
98
  end
94
99
 
@@ -97,11 +102,9 @@ module ImpExp
97
102
  end
98
103
 
99
104
  def rows(scoping_parent)
100
- rows = []
101
- preload_associations(order(scoped(scoping_parent))).each do |record|
102
- rows << row(record)
105
+ preload_associations(order(scoped(scoping_parent))).map do |record|
106
+ row(record)
103
107
  end
104
- rows
105
108
  end
106
109
 
107
110
  def row(record)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ImpExp
4
- VERSION = "1.0.4"
4
+ VERSION = "1.0.6"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imp_exp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dev team Nerya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-26 00:00:00.000000000 Z
11
+ date: 2024-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: caxlsx
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: observer
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">"
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">"
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rails
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -33,7 +47,7 @@ dependencies:
33
47
  version: 7.0.0
34
48
  - - "<"
35
49
  - !ruby/object:Gem::Version
36
- version: 7.2.0
50
+ version: 8.0.0
37
51
  type: :runtime
38
52
  prerelease: false
39
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +57,7 @@ dependencies:
43
57
  version: 7.0.0
44
58
  - - "<"
45
59
  - !ruby/object:Gem::Version
46
- version: 7.2.0
60
+ version: 8.0.0
47
61
  - !ruby/object:Gem::Dependency
48
62
  name: rubyzip
49
63
  requirement: !ruby/object:Gem::Requirement