My quick solution was to add a link wrapped within a
Rails.env=='development' check that triggers the following method

def reload_abilities
redirect_to :root

Now I just need to click that link instead of restarting the server.
On Thursday, January 31, 2013 10:03:04 PM UTC-8, Sunil Gowda wrote:

Hi All,
I have a bunch of custom abilities added to a new role. All that is
working very well. However, whenever I make a code change (template edits
are fine), my custom abilities are gone. This is major pain during
development as I have to restart the server on every code change. Is anyone
else experiencing this?

After debugging a bit, I have traced it to a few spots, but I am not sure
how to fix it. CanCan's @current_ability is reset to nil (at some
unidentified location) and assigned to a new Spree::Ability instance in
Spree::Core::ControllerHelper's current_ability method. Since the
initializers are not executed, the new abilities are not registered.

Any help is greatly appreciated.

Sunil Gowda
You received this message because you are subscribed to the Google Groups "Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupspree-user @
postedFeb 1, '13 at 7:58a
activeFeb 2, '13 at 4:16a

1 user in discussion

Sunil Gowda: 2 posts



site design / logo © 2022 Grokbase