Module: HasScope

Defined in:
lib/has_scope.rb,
lib/has_scope/railtie.rb,
lib/has_scope/version.rb

Defined Under Namespace

Modules: ClassMethods Classes: Railtie

Constant Summary collapse

TRUE_VALUES =
["true", true, "1", 1]
ALLOWED_TYPES =
{
  array:   [[ Array ]],
  hash:    [[ Hash, ActionController::Parameters ]],
  boolean: [[ Object ], -> v { TRUE_VALUES.include?(v) }],
  default: [[ String, Numeric ]],
}
VERSION =
"0.8.2"

Class Method Summary collapse

Class Method Details

.deprecatorObject



14
15
16
# File 'lib/has_scope.rb', line 14

def self.deprecator
  @deprecator ||= ActiveSupport::Deprecation.new("1.0", "HasScope")
end

.included(base) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/has_scope.rb', line 18

def self.included(base)
  base.class_eval do
    extend ClassMethods
    class_attribute :scopes_configuration, instance_writer: false
    self.scopes_configuration = {}
  end
end