Sha256: 61575b485e73397f0052c7a230bed6bdafdf0fa161cf1d3ec0f27848b546bb24

Contents?: true

Size: 839 Bytes

Versions: 6

Compression:

Stored size: 839 Bytes

Contents

# see https://github.com/amatsuda/kaminari/blob/master/lib/kaminari/config.rb
module Adhoq
  class Configuration
    include ActiveSupport::Configurable

    config_accessor :storage do
      [:on_the_fly]
    end

    config_accessor :base_controller do
      'ApplicationController'
    end

    config_accessor :authorization
    config_accessor :authorization_failure_action

    config_accessor :current_user

    config_accessor :database_connection
    config_accessor :hidden_model_names
    config_accessor :hide_rows_count

    config_accessor :async_execution
    config_accessor :job_queue_name

    def callablize(name)
      if (c = config[name]).respond_to?(:call)
        c
      else
        c.to_proc
      end
    end

    def async_execution?
      defined?(ActiveJob) && Adhoq.config.async_execution
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
adhoq-1.0.2 lib/adhoq/configuration.rb
adhoq-1.0.1 lib/adhoq/configuration.rb
adhoq-1.0.0 lib/adhoq/configuration.rb
adhoq-0.5.0 lib/adhoq/configuration.rb
adhoq-0.5.0.beta1 lib/adhoq/configuration.rb
adhoq-0.4.0 lib/adhoq/configuration.rb