config/routes.rb in declarative_authorization-0.5.1 vs config/routes.rb in declarative_authorization-0.5.2

- old
+ new

@@ -1,10 +1,20 @@ -# Rails 3 depreciates ActionController::Routing::Routes -routes = (Rails.respond_to?(:application) ? Rails.application.routes : ActionController::Routing::Routes) - -routes.draw do |map| - if Authorization::activate_authorization_rules_browser? - map.resources :authorization_rules, :only => [:index], - :collection => {:graph => :get, :change => :get, :suggest_change => :get} - map.resources :authorization_usages, :only => :index +if Authorization::activate_authorization_rules_browser? + if Rails.respond_to?(:application) + Rails.application.routes.draw do + resources :authorization_rules, :only => [:index] do + collection do + get :graph + get :change + get :suggest_change + end + end + resources :authorization_usages, :only => :index + end + else + ActionController::Routing::Routes.draw do |map| + map.resources :authorization_rules, :only => [:index], + :collection => {:graph => :get, :change => :get, :suggest_change => :get} + map.resources :authorization_usages, :only => :index + end end -end \ No newline at end of file +end