imp_exp 1.0.4 → 1.0.5

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: 6778be6a5af145d10c0e080a3a33085a8721d41cc3080b7e4e9ac0b49e35f8ed
4
+ data.tar.gz: d1b14539b4d4fde177d944913006b5251ac9b4f28e04d889e36b9a383bb67f39
5
5
  SHA512:
6
- metadata.gz: 6f905a7e04c2417a3cd12ae4cda425c336ff0bf2b072b8fd3d4c0e9f7b74b383a912642a5ff604287cdf3532acd4f16108fcd25a184bc5d3d847720c53ae0861
7
- data.tar.gz: ac0b3a963e9ae3ec5576ea8513e0b0c357673cf6af5da4a0d7b7a97f301e218fc77c192043cb6890b6561d0d52d986c5f4f2fdd3f2dd9ca422b21a11118c0d66
6
+ metadata.gz: 3d45e45c432147983beb0c7f5d1ed7052f3e34de499eba768feabdec55fc201db8bb68c91932b05cdd0177166cd796985c36bd234d8e6f11d274c9ec8333ead2
7
+ data.tar.gz: d540eba3c9fd5d711c3d9a036045bcea0969bd5f10f829b12f3efe9b58acd28a4435fcbe85195e1d32e3ee9a4b2804da61f36cb47e618fbdc83b71504e6b08ef
@@ -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.5"
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.5
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-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: caxlsx