Sha256: a8fed0e9e0eb68394d9d50dde3c0cfa77b0669c4aff6fd61aa105e1bce46fece

Contents?: true

Size: 777 Bytes

Versions: 4

Compression:

Stored size: 777 Bytes

Contents

# frozen_string_literal: true

require "active_support/lazy_load_hooks"
require "global_registry_bindings/global_registry_bindings"
require "global_registry_bindings/railtie" if defined? ::Rails::Railtie

module GlobalRegistry
  module Bindings
    def self.configure
      yield self
    end

    def self.sidekiq_options
      @sidekiq_options ||= {}
    end

    def self.sidekiq_options=(opts)
      @sidekiq_options = opts
    end

    def self.redis_error_action
      @redis_error_action ||= :log
    end

    def self.redis_error_action=(action)
      action = :log unless %i[ignore log raise].include? action
      @redis_error_action = action
    end
  end
end

ActiveSupport.on_load(:active_record) do
  ActiveRecord::Base.send :extend, GlobalRegistry::Bindings
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
global-registry-bindings-0.7.2 lib/global_registry_bindings.rb
global-registry-bindings-0.7.1 lib/global_registry_bindings.rb
global-registry-bindings-0.7 lib/global_registry_bindings.rb
global-registry-bindings-0.6.3 lib/global_registry_bindings.rb