We need to give the ActiveRecord classes a handle to the current ability. We don’t want to just pass the object, because the object may change (someone may log in or out). So we give ActiveRecord a proc that ties to the current_ability_method on this ApplicationController.
# File lib/active_scaffold/bridges/cancan/cancan_bridge.rb, line 67 def assign_current_ability_to_models ::ActiveRecord::Base.current_ability_proc = proc {send(:current_ability)} end