Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Properly pass controller to authorization adapter, bug introduced by

  • Loading branch information...
commit c212c55f3d02fab8d8a23405bd258161e6ff2cb7 1 parent 5a089c7
@kaapa kaapa authored
Showing with 3 additions and 3 deletions.
  1. +1 −1  lib/rails_admin/config.rb
  2. +2 −2 spec/lib/rails_admin_spec.rb
View
2  lib/rails_admin/config.rb
@@ -132,7 +132,7 @@ def authorize_with(*args, &block)
extension = args.shift
if(extension)
@authorize = Proc.new {
- @authorization_adapter = RailsAdmin::AUTHORIZATION_ADAPTERS[extension].new(*([RailsAdmin] + args).compact)
+ @authorization_adapter = RailsAdmin::AUTHORIZATION_ADAPTERS[extension].new(*([self] + args).compact)
}
else
@authorize = block if block
View
4 spec/lib/rails_admin_spec.rb
@@ -35,7 +35,7 @@
end
it "initializes the authorization adapter" do
- ExampleModule::AuthorizationAdapter.should_receive(:new).with(RailsAdmin)
+ ExampleModule::AuthorizationAdapter.should_receive(:new).with(RailsAdmin::Config)
RailsAdmin.config do |config|
config.authorize_with(:example)
end
@@ -44,7 +44,7 @@
it "passes through any additional arguments to the initializer" do
options = { :option => true }
- ExampleModule::AuthorizationAdapter.should_receive(:new).with(RailsAdmin, options)
+ ExampleModule::AuthorizationAdapter.should_receive(:new).with(RailsAdmin::Config, options)
RailsAdmin.config do |config|
config.authorize_with(:example, options)
end
Please sign in to comment.
Something went wrong with that request. Please try again.