spree/spree — pull request #1014 by paulsponagl (2012-01-24 14:16:16+00:00)
Title: fix register_ability by removing broken and useless decorators

i tried to setup custom abilities using spree edge.
See [Spree Permissions, custom roles][1] for more information.
... not working...

The fix is simple though:

remove admin_resource_controller_decorator.rb:

First i realized that admin_resource_controller_decorator.rb would not work as cancan hasn't an implementation of registering a class by supplying a proc - so the lambda would never be called.
Second i found that the Spree::Admin::ResourceController inherits the Spree::Admin::BaseController authorize_admin filter - so there is no need for this broken admin_resource_controller_decorator.rb

and remove resource_controller_decorator.rb:

This controller decorator not beeing namespaced seems to be old stuff and prevents the whole engine from running (users_controller.rb : 3:in `<module:Admin>': wrong argument type Module (expected Class))

After the removal of those two files register_ability works as expected.

btw.

```ruby
Rails.configuration.to_prepare do
Spree::Ability.register_ability(MyCustomAbility)
end
```
is needed to make sure everything gets properly reloaded in development.

[1]: http://groups.google.com/group/spree-user/browse_frm/thread/1e819e10410d03c5/b7b2722b6d63c7e2?lnk=gst&q=cancan#b7b2722b6d63c7e2