Permalink
Browse files

enabling hooks

  • Loading branch information...
shenoudab committed Jun 17, 2010
1 parent 7f6ee23 commit c4e1b9b53c8bbec0eee3797562bd09dedd69e85d
Showing with 17 additions and 7 deletions.
  1. +2 −1 .gitignore
  2. +6 −2 lib/devise_traceable.rb
  3. +4 −2 lib/devise_traceable/hooks/traceable.rb
  4. +5 −2 lib/devise_traceable/rails.rb
View
@@ -1,4 +1,5 @@
.bundle/
log/*.log
pkg/
-test/
+nbproject/
+test/
View
@@ -2,5 +2,9 @@
require 'devise'
end
-require 'devise_traceable/model'
-require 'devise_traceable/rails'
+module DeviseTraceable
+ require 'devise_traceable/rails'
+end
+
+Devise.add_module :traceable, :model => 'devise_traceable/model'
+
@@ -4,13 +4,15 @@
# not trigger it.
Warden::Manager.after_set_user :except => :fetch do |record, warden, options|
+ puts record
if record.respond_to?(:insert_login!) #&& warden.authenticated?(options[:scope])
record.insert_login!(warden.request)
end
end
-Warden::Manager.before_logout do |record, auth, opts|
- if record.respond_to?(:update_logout!) #&& warden.authenticated?(options[:scope])
+Warden::Manager.before_logout do |record, warden, opts|
+ puts record
+ if record.respond_to?(:update_logout!)
record.update_logout!(warden.request)
end
end
@@ -1,5 +1,8 @@
+require 'devise_traceable'
+require 'rails'
+
module DeviseTraceable
class Engine < ::Rails::Engine
-
+ engine_name :devise_taceable
end
-end
+end

0 comments on commit c4e1b9b

Please sign in to comment.