module ActiveReporting::Configuration
Attributes
Determines if ransack is available for use in the gem
@return [Boolean]
Public Class Methods
# File lib/active_reporting/configuration.rb, line 12 def self.config yield self end
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
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
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
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
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
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
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
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