Sha256: 331c8f9f706a2ba5eca0e97b0a578e3d7905a87918c27079a4dbf05c05447911

Contents?: true

Size: 777 Bytes

Versions: 10

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

10 entries across 10 versions & 1 rubygems

Version Path
global-registry-bindings-0.6.2 lib/global_registry_bindings.rb
global-registry-bindings-0.6.1 lib/global_registry_bindings.rb
global-registry-bindings-0.6.0 lib/global_registry_bindings.rb
global-registry-bindings-0.5.0 lib/global_registry_bindings.rb
global-registry-bindings-0.4.0 lib/global_registry_bindings.rb
global-registry-bindings-0.3.3 lib/global_registry_bindings.rb
global-registry-bindings-0.3.2 lib/global_registry_bindings.rb
global-registry-bindings-0.3.1 lib/global_registry_bindings.rb
global-registry-bindings-0.3.0 lib/global_registry_bindings.rb
global-registry-bindings-0.2.0 lib/global_registry_bindings.rb