cuetip 1.2.0 → 1.3.0

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: 80caddd838028973a0877c6a4b303d0b36b6ad6f5c98564ed865a60f41ce348a
4
- data.tar.gz: 8b5a04b3537ff9a6bad21225ea11becb3ce5d2b2dd1e8c4f30cf8649a55f90d9
3
+ metadata.gz: fb9bb24e692fd6dd36474dacfbce871a57e5fbf89e76751c14e3800d94edf4c6
4
+ data.tar.gz: e02635ecc69e6ac817259f876f87b48cf188452fc9a4869cb76c2edd2be874f3
5
5
  SHA512:
6
- metadata.gz: d4b32a2ec0ad43135fd41e9a81cccf217a6415058f43244972835d6f902b5b6ac54cedd547dad7643a0a7ca7852d7a469465b263d2f392d6ba53f191f824accc
7
- data.tar.gz: e02bbcd49dac8eada655e0b86d5ce31d8e1f9bf6186e0e0bd14ff79cf2927102a4a3457b6e31fe624a0e486f9b18ca1041244efa57de618ec8e0e1ad16c80dda
6
+ metadata.gz: 528e2243bdfd1fc770d3009d6fa1b04682a27e6fca021b2a114ee28d501c94f5647b89be5f3117ab3f1d634d4598f9719d9af28bc1ac19bcd5ed4d98d6ed027f
7
+ data.tar.gz: 3899852d6e2c92f23f2abff21a51c2c70329abb99b49e3da446f8e74c9614f6090d74c4f9e20b5c03378fcc937e2d9565e903a0b2cac820d3410c18bbfbfd25c
@@ -62,6 +62,13 @@ module Cuetip
62
62
  # Return the job
63
63
  job
64
64
  end
65
+
66
+ # Prune jobs before a specific time
67
+ #
68
+ # @param before [ActiveSupport::TimeWithZone] The point in time to prune jobs until.
69
+ def prune(before)
70
+ Models::Job.where('created_at < ?', before).destroy_all
71
+ end
65
72
  end
66
73
 
67
74
  # Initialize this job instance by providing a queued job instance
@@ -11,7 +11,7 @@ module Cuetip
11
11
 
12
12
  STATUSES = %w[Pending Running Complete Aborted Expired].freeze
13
13
 
14
- has_one :queued_job, class_name: 'Cuetip::Models::QueuedJob'
14
+ has_one :queued_job, class_name: 'Cuetip::Models::QueuedJob', dependent: :destroy
15
15
  belongs_to :associated_object, polymorphic: true, optional: true
16
16
 
17
17
  serialize :params, Cuetip::SerializedHashie
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cuetip
4
- VERSION = '1.2.0'
4
+ VERSION = '1.3.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuetip
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-27 00:00:00.000000000 Z
11
+ date: 2020-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord