Permalink
Browse files

Observers' context (current_user) is set on every request.

  • Loading branch information...
1 parent af840ec commit 3a30577009aa310e08196d269079fbdef08a7b8e @jasiek committed Jan 12, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 user_pages_extension.rb
View
@@ -26,6 +26,11 @@ def activate
User.send(:include, UserExtension)
Admin::PagesController.send(:include, AdminPagesControllerExtension)
Admin::PagesController.send(:helper, AdminPagesHelperExtension)
+ ApplicationController.class_eval do
+ def set_current_user
+ PageObserver.current_user = UserPagePermissionObserver.current_user = UserActionObserver.current_user = current_user
+ end
+ end
# tab 'Content' do
# add_item "User Pages", "/admin/user_pages", :after => "Pages"
# end

0 comments on commit 3a30577

Please sign in to comment.