importo 2.0.4 → 2.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: a20759f65aaabdc3812973d96d19ba69854eeeb75ec421b779b6da6890b2d916
4
- data.tar.gz: faaba7cb0ceef82f36b161049fdd0eda76c0b14363e7a78636756624cecd6b00
3
+ metadata.gz: 6005b4d69612846b48c464ea6dfe53d763498518201576610e26e5ee7b99a1a9
4
+ data.tar.gz: bf6b4711e93260528cb440217588155dd815874666e7296715e2878559153001
5
5
  SHA512:
6
- metadata.gz: 59e08eb163844c774f4cdf74bcbb1365b971049c7d986687e80d2acc99512c509907a1b148dd41f4d3e99dd1345c09b2a80595e9987fca06cf8479dff48e34bf
7
- data.tar.gz: 0e750e8752d3467e4ffedd4305c1b81d17f981c604a02d48200464278a9914b87b946e6fc7a9a74b0f73900ad79508ecaf9c6e0ba44e9ac7fe8e63519e3a2f59
6
+ metadata.gz: 3728c3639169ec860471b1a80f3b293c4ee987748f0004f26978a9f716ef1b9ad69ac48bb49a7cc2a42b90083ca89322100aab6ba3164b329accdb3a036a19d2
7
+ data.tar.gz: 047d674853e4facae068811e41579bc3c01af12ef9680c06151a80816bc8d0639e809607763d9be76d96cfb00a392236d623186887b22716ea2d0e63fabd81d8
@@ -0,0 +1,4 @@
1
+ module Importo
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,14 @@
1
+ module Importo
2
+ class PurgeImportJob < ApplicationJob
3
+ def perform(owner, months)
4
+ imports = Import.where(importo_ownable: owner, created_at: ..months.months.ago.beginning_of_day)
5
+
6
+ imports.each do |import|
7
+ import.original.purge
8
+ import.result.purge
9
+ end
10
+
11
+ imports.in_batches.destroy_all
12
+ end
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Importo
4
- VERSION = '2.0.4'
4
+ VERSION = "2.0.5"
5
5
  end
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: 2.0.4
4
+ version: 2.0.5
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: 2022-11-07 00:00:00.000000000 Z
12
+ date: 2022-11-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: caxlsx
@@ -274,6 +274,8 @@ files:
274
274
  - app/importers/concerns/result_feedback.rb
275
275
  - app/importers/concerns/revertable.rb
276
276
  - app/importers/importo/base_importer.rb
277
+ - app/jobs/importo/application_job.rb
278
+ - app/jobs/importo/purge_import_job.rb
277
279
  - app/mailers/importo/application_mailer.rb
278
280
  - app/models/importo/application_record.rb
279
281
  - app/models/importo/import.rb