module ActiveReporting::Configuration

Attributes

ransack_available[RW]

Determines if ransack is available for use in the gem

@return [Boolean]

Public Class Methods

config() { |self| ... } click to toggle source
# File lib/active_reporting/configuration.rb, line 12
def self.config
  yield self
end
default_dimension_label() click to toggle source

The default label used by all dimensions if not set otherwise

Default value is `:name`

# File lib/active_reporting/configuration.rb, line 19
def self.default_dimension_label
  @default_dimension_label ||= :name
end
default_dimension_label=(dimension_label) click to toggle source

Sets the default dimension label to be used by all dimensions

@param dimension_label [String, Symbol] @return [Symbol]

# File lib/active_reporting/configuration.rb, line 27
def self.default_dimension_label=(dimension_label)
  @default_dimension_label = dimension_label.to_sym
end
default_measure() click to toggle source

The default measture for all fact models

Default value is `:value“

# File lib/active_reporting/configuration.rb, line 34
def self.default_measure
  @default_measure ||= :value
end
default_measure=(measure) click to toggle source

Sets the default measture to be used by all fact models

@param measure [String, Symbol] @return [Symbol]

# File lib/active_reporting/configuration.rb, line 42
def self.default_measure=(measure)
  @default_measure = measure.to_sym
end
metric_lookup_class() click to toggle source

Sets the name of the constant used to lookup prebuilt `Reporting::Metric` objects by name. The constant should define a class method called `#lookup` which can take a string or symbol of the metric name.

Default value is ::Metric

@returns [String]

# File lib/active_reporting/configuration.rb, line 78
def self.metric_lookup_class
  @metric_lookup_class ||= '::Metric'
end
metric_lookup_class=(klass_name) click to toggle source

Sets the name of the constant used to lookup prebuilt `Reporting::Metric` objects by name.

@param klass_name [String]

# File lib/active_reporting/configuration.rb, line 67
def self.metric_lookup_class=(klass_name)
  @metric_lookup_class = "::#{klass_name.to_s.classify}"
end
ransack_fallback() click to toggle source

Tells if unkown dimension filters should always fallback to ransack

Default value is `false`

@return [Boolean]

# File lib/active_reporting/configuration.rb, line 51
def self.ransack_fallback
  @ransack_fallback ||= false
end
ransack_fallback=(fallback) click to toggle source

Sets the flag to always fallback to ransack for unknown dimension filters @param fallback [Boolean] @return [Boolean]

# File lib/active_reporting/configuration.rb, line 58
def self.ransack_fallback=(fallback)
  raise RansackNotAvailable unless ransack_available
  @ransack_fallback = fallback
end