Sha256: 9709baf79d70c20ca4920d8e78b9581e5bcb779954203f861212348d1aba4f8e
Contents?: true
Size: 695 Bytes
Versions: 18
Compression:
Stored size: 695 Bytes
Contents
module Devise module Strategies # Base strategy for Devise. Responsible for verifying correct scope and mapping. module Base # Validate strategy. By default will raise an error if no scope or an # invalid mapping is found. def valid? raise "Could not find mapping for #{scope}" unless mapping mapping.for.include?(klass_type) end # Checks if a valid scope was given for devise and find mapping based on # this scope. def mapping Devise.mappings[scope] end # Store this class type. def klass_type @klass_type ||= self.class.name.split("::").last.underscore.to_sym end end end end
Version data entries
18 entries across 18 versions & 1 rubygems