Module: MerbAuthSliceActivation
- Defined in:
- lib/merb-auth-slice-activation.rb
Overview
All Slice code is expected to be namespaced inside a module
Defined Under Namespace
Classes: ActivationMailer, Activations, Application
Class Method Summary collapse
-
.activate ⇒ Object
Activation hook - runs after AfterAppLoads BootLoader.
-
.deactivate ⇒ Object
Deactivation hook - triggered by Merb::Slices.deactivate(MerbAuthSliceActivation).
-
.init ⇒ Object
Initialization hook - runs before AfterAppLoads BootLoader.
-
.loaded ⇒ Object
Stub classes loaded hook - runs before LoadClasses BootLoader right after a slice’s classes have been loaded internally.
-
.setup_router(scope) ⇒ Object
Setup routes inside the host application.
Class Method Details
.activate ⇒ Object
Activation hook - runs after AfterAppLoads BootLoader
51 52 |
# File 'lib/merb-auth-slice-activation.rb', line 51 def self.activate end |
.deactivate ⇒ Object
Deactivation hook - triggered by Merb::Slices.deactivate(MerbAuthSliceActivation)
55 56 |
# File 'lib/merb-auth-slice-activation.rb', line 55 def self.deactivate end |
.init ⇒ Object
Initialization hook - runs before AfterAppLoads BootLoader
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/merb-auth-slice-activation.rb', line 39 def self.init # Actually check if the user is active ::Merb::Authentication.after_authentication do |user, *rest| if user.respond_to?(:active?) user.active? ? user : nil else user end end end |
.loaded ⇒ Object
Stub classes loaded hook - runs before LoadClasses BootLoader right after a slice’s classes have been loaded internally.
35 36 |
# File 'lib/merb-auth-slice-activation.rb', line 35 def self.loaded end |
.setup_router(scope) ⇒ Object
prefix your named routes with :merb_auth_slice_activation_ to avoid potential conflicts with global named routes.
Setup routes inside the host application
67 68 69 |
# File 'lib/merb-auth-slice-activation.rb', line 67 def self.setup_router(scope) scope.match("/activate/:activation_code").to(:controller => "activations", :action => "activate").name(:activate) end |