Skip to content

Commit

Permalink
Merge pull request ricodigo#2 from guilleiguaran/use-railtie-for-rail…
Browse files Browse the repository at this point in the history
…s-config

Move middleware enabling to a railtie
  • Loading branch information
dcu committed Oct 1, 2011
2 parents f6ef608 + 7a9e06e commit 9099155
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 0 additions & 4 deletions README.rdoc
Expand Up @@ -18,10 +18,6 @@ add this to config/routes.rb:
...
mount BugHunter.app => ENV["BUGHUNTER_PATH"]

enable the middleware on config/application.rb:

config.middleware.use "BugHunter::Middleware"


== Contributing to bug_hunter

Expand Down
1 change: 1 addition & 0 deletions lib/bug_hunter.rb
Expand Up @@ -22,6 +22,7 @@
require 'bug_hunter/routes_helper'
require 'bug_hunter/models'
require 'bug_hunter/app'
require 'bug_hunter/railtie' if defined?(Rails) && Rails::VERSION::MAJOR >= 3

module BugHunter
def self.app
Expand Down
7 changes: 7 additions & 0 deletions lib/bug_hunter/railtie.rb
@@ -0,0 +1,7 @@
module BugHunter
class Railtie < ::Rails::Railtie
initializer "bug_hunter.enable_middleware" do |app|
app.middleware.use "BugHunter::Middleware"
end
end
end

0 comments on commit 9099155

Please sign in to comment.