Skip to content

Commit

Permalink
mounting sidekiq web
Browse files Browse the repository at this point in the history
  • Loading branch information
macool committed Jan 14, 2014
1 parent bd63a69 commit 81852fa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require "sidekiq/web"
require "admin_constraint"

Sani::Application.routes.draw do

root "home#index"
Expand All @@ -14,4 +17,7 @@
namespace :api do
resources :transacciones
end

# sidekiq:
mount Sidekiq::Web, at: "/sidekiq_web", :constraints => AdminConstraint.new
end
7 changes: 7 additions & 0 deletions lib/admin_constraint.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class AdminConstraint
def matches?( request )
return false unless request.session[:user_id]
user = User.cached_find request.session[:user_id]
user
end
end

0 comments on commit 81852fa

Please sign in to comment.