Sha256: 1cce49a19087a2451d4631b4e42793b81163b7aae05cd5389b5c50df4fe167ea

Contents?: true

Size: 579 Bytes

Versions: 10

Compression:

Stored size: 579 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.configured_orm
      Doorkeeper.configuration.orm
    end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
doorkeeper-5.2.6 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.2.5 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.2.4 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.2.3 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.2.2 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.2.1 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.2.0 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.2.0.rc3 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.2.0.rc2 lib/doorkeeper/stale_records_cleaner.rb
doorkeeper-5.2.0.rc1 lib/doorkeeper/stale_records_cleaner.rb