Sha256: e2b421744515211d404050756f4bc0b69c2e48deb21e5f4290a5e9d71a2c3e32

Contents?: true

Size: 572 Bytes

Versions: 23

Compression:

Stored size: 572 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  class StaleRecordsCleaner
    CLEANER_CLASS = "StaleRecordsCleaner"

    def self.for(base_scope)
      orm_adapter = "doorkeeper/orm/#{configured_orm}".classify

      orm_cleaner = "#{orm_adapter}::#{CLEANER_CLASS}".constantize
      orm_cleaner.new(base_scope)
    rescue NameError
      raise Doorkeeper::Errors::NoOrmCleaner, "'#{configured_orm}' ORM has no cleaner!"
    end

    def self.new(base_scope)
      self.for(base_scope)
    end

    def self.configured_orm
      Doorkeeper.config.orm
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
doorkeeper-5.8.0 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.7.1 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.7.0 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.6.9 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.6.8 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.6.7 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.6.6 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.6.5 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.6.4 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.6.3 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.6.2 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.6.1 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.6.0 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.6.0.rc2 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.6.0.rc1 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.5.4 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.5.3 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.5.2 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.5.1 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.5.0 lib/doorkeeper/stale_records_cleaner.rb