cancan icon indicating copy to clipboard operation
cancan copied to clipboard

Only load necessary abilities?

Open johncox00 opened this issue 9 years ago • 0 comments

I have an application with quite a few models and lots of "cans" and "cannots" associated with those models. The problem I'm running into is that running the initialize method on ability.rb makes quite a few database calls and the aggregate time to authorize a user per call into my API is quite long before I even execute code based on the authorization.

Is there a way to only run the ability definitions necessary for specific logic? Almost like lazy loading abilities? Am I missing something?

johncox00 avatar Oct 21 '14 20:10 johncox00