Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Experimental support for CanCan"

This reverts commit 32d522b.
  • Loading branch information...
commit 492b76036678e7b6ac89235641f79104cd01f570 1 parent 32d522b
@pcreux pcreux authored
View
1  lib/active_admin.rb
@@ -3,7 +3,6 @@
require 'will_paginate'
require 'sass'
require 'active_admin/arbre'
-require 'active_admin/cancan'
module ActiveAdmin
View
22 lib/active_admin/cancan.rb
@@ -1,22 +0,0 @@
-# Support for CanCan within Active Admin
-
-module ActiveAdmin
- module CanCan
- if defined?(::CanCan)
-
- class ControllerResource < ::CanCan::InheritedResource
- def resource_base
- @controller.send :collection
- end
- end
-
- module ControllerAdditions
- def cancan_resource_class
- ::ActiveAdmin::CanCan::ControllerResource
- end
- end
-
- ActiveAdmin::ResourceController.send :include, ControllerAdditions
- end
- end
-end
View
2  lib/active_admin/resource_controller/collection.rb
@@ -126,7 +126,7 @@ def setup_pagination_for_csv
end
def paginate(chain)
- @paginated_collection = chain.paginate(:page => params[:page], :per_page => @per_page || ActiveAdmin.default_per_page)
+ chain.paginate(:page => params[:page], :per_page => @per_page || ActiveAdmin.default_per_page)
end
end
View
22 spec/unit/cancan_spec.rb
@@ -1,22 +0,0 @@
-# Mock out CanCan
-module CanCan
- class InheritedResource
- def initialize(controller)
- @controller = controller
- end
- end
-end
-
-require 'spec_helper'
-
-describe ActiveAdmin::CanCan do
-
- describe ActiveAdmin::CanCan::ControllerResource do
- it "should return the collection for cancan to use" do
- controller = mock("MockController")
- controller.should_receive(:collection)
- ActiveAdmin::CanCan::ControllerResource.new(controller).resource_base
- end
- end
-
-end
Please sign in to comment.
Something went wrong with that request. Please try again.