Sha256: b7e4db155fb256cdfcb8a3a387bfb391ac9cc155d90e48c9ff529315a1289cc3

Contents?: true

Size: 276 Bytes

Versions: 9

Compression:

Stored size: 276 Bytes

Contents

# frozen_string_literal: true

if defined?(ActiveRecord::Base)
  module MiniScheduler
    class Stat < ActiveRecord::Base

      self.table_name = 'scheduler_stats'

      def self.purge_old
        where('started_at < ?', 1.months.ago).delete_all
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mini_scheduler-0.16.0 app/models/mini_scheduler/stat.rb
mini_scheduler-0.15.0 app/models/mini_scheduler/stat.rb
mini_scheduler-0.14.0 app/models/mini_scheduler/stat.rb
mini_scheduler-0.13.0 app/models/mini_scheduler/stat.rb
mini_scheduler-0.12.3 app/models/mini_scheduler/stat.rb
mini_scheduler-0.12.2 app/models/mini_scheduler/stat.rb
mini_scheduler-0.12.1 app/models/mini_scheduler/stat.rb
mini_scheduler-0.12.0 app/models/mini_scheduler/stat.rb
mini_scheduler-0.11.0 app/models/mini_scheduler/stat.rb