Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: stffn/declarative_authorization
base: master
...
head fork: pietervisser/declarative_authorization
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 17 additions and 7 deletions.
  1. +17 −7 config/routes.rb
View
24 config/routes.rb
@@ -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 commit comments for this range

Something went wrong with that request. Please try again.