imp_exp 1.0.1 → 1.0.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: 1f6b7710da995a74b9cb5bb802dfa8c66edbaef08d62e73496ffc6d7114a3f1a
4
- data.tar.gz: 10c8eb01aac1d4f7d8798ddb63526f6537df737650fbaff548771fe46a3b7faa
3
+ metadata.gz: 95c01a0e842b07be48cdb4ba9d3c8c86b290be303ac295ae7e3bed32c25890b6
4
+ data.tar.gz: dfaeeb8bd81df45530ce3fffea3d836c8d443fda8c82cf6f959bd02794c6f27d
5
5
  SHA512:
6
- metadata.gz: f55554549a88b4451351506085d8b5b0262d64e3c5daa96831f11bcd6b8b45e30637dd0047f4540c8c446a2d94020a9895034266cb00bd15f4c8ef607196099a
7
- data.tar.gz: 0ce0baaf3510dd462f15ecc13d5c3108c7aa6b15034319c11a4367ee8e325625cfd956e4d05af222bbf5d7b9c48addf96c08671be0f1f7df8d2920ebf656b8c9
6
+ metadata.gz: b916927e79f41a5f39f59d55355f4e60fdb13442584eb6192dae9deaf23d4349ef32c9b448f7d5deb056c060b65b8fec083a0bcc45e167d0119c67e1bde71e93
7
+ data.tar.gz: 7783e50180c86bc6d9bff432e472b2426c480e6bdfc47307a0c1496a5af1fd5aa4ab223128078767eb38c6d9f2b1623da9bfdc2bc7f3d6e6aae2339ec6538997
@@ -50,7 +50,7 @@ module ImpExp
50
50
  { imported: imported, import_errors: errors }
51
51
  end
52
52
 
53
- def import_model_data(model, model_data, files_directory_path)
53
+ def import_model_data(model, model_data, files_directory_path) # rubocop:disable Metrics/MethodLength
54
54
  model_data.each_with_index do |row, i|
55
55
  line = ROW_OFFSET + i + 1
56
56
  model_name = model.model_name
@@ -76,6 +76,7 @@ module ImpExp
76
76
  attach_files(record, files_directory_path, model, row, line) if files_directory_path.present?
77
77
 
78
78
  if record.save(context: :import)
79
+ model.after_save(record)
79
80
  @imported[model.model_name] += 1
80
81
  next
81
82
  end
@@ -136,6 +136,8 @@ module ImpExp
136
136
  "#{active_storage_file.name}-#{active_storage_file.record.code}#{file_extension(active_storage_file)}"
137
137
  end
138
138
 
139
+ def after_save(_record); end
140
+
139
141
  private
140
142
 
141
143
  def file_extension(active_storage_file)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ImpExp
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.3"
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.1
4
+ version: 1.0.3
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: 2023-11-21 00:00:00.000000000 Z
11
+ date: 2024-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: caxlsx
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  requirements: []
125
- rubygems_version: 3.4.10
125
+ rubygems_version: 3.4.19
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: Import data from xlsx into a rails app and export data to xlsx from a rails