Sha256: d4d7cc0a595f283bf5785a2417826f4bb33a99e4c4f8832dd06b461ccaeae3bc

Contents?: true

Size: 746 Bytes

Versions: 23

Compression:

Stored size: 746 Bytes

Contents

# frozen_string_literal: true

require "rails_pg_extras/web"

module RailsPgExtras
  class Configuration
    DEFAULT_CONFIG = { enabled_web_actions: Web::ACTIONS - [:kill_all], public_dashboard: ENV["RAILS_PG_EXTRAS_PUBLIC_DASHBOARD"] == "true" }

    attr_reader :enabled_web_actions
    attr_accessor :public_dashboard

    def initialize(attrs)
      self.enabled_web_actions = attrs[:enabled_web_actions]
      self.public_dashboard = attrs[:public_dashboard]
    end

    def enabled_web_actions=(*actions)
      @enabled_web_actions = actions.flatten.map(&:to_sym)
    end
  end

  def self.configuration
    @configuration ||= Configuration.new(Configuration::DEFAULT_CONFIG)
  end

  def self.configure
    yield(configuration)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rails-pg-extras-5.5.1 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.5.0 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.4.5 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.4.3 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.4.2 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.4.1 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.4.0 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.3.1 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.3.0 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.2.5 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.2.4 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.2.3 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.2.2 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.2.1 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.2.0 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.1.0 lib/rails_pg_extras/configuration.rb
rails-pg-extras-5.0.0 lib/rails_pg_extras/configuration.rb
rails-pg-extras-4.13.0 lib/rails_pg_extras/configuration.rb
rails-pg-extras-4.12.2 lib/rails_pg_extras/configuration.rb
rails-pg-extras-4.12.1 lib/rails_pg_extras/configuration.rb