ryanb/cancan — Issue #489: authorize! method without any arguments?
Author: barmstrong
Created: 2011-10-11 22:47:17+00:00
State: open

It seems like you might be able to make an authorize! method which figures out the arguments on it's on in the default case. Something like...

def authorize!
model_name = params[:controller].singularize
authorize!(params[:action].to_sym, instance_variable_get("@#{model_name}") || model_name.constantize)
end

It could also be the same method but use default arguments. Would something like this work or make sense?