Module: ActiveScaffold::Bridges::Cancan::ClassMethods

Defined in:
lib/active_scaffold/bridges/cancan/cancan_bridge.rb

Overview

controller level authorization As already has callbacks to ensure authorization at controller method via “authorization_method” but let’s include this too, just in case, no sure how performance is affected tough :TODO benchmark

Instance Method Summary collapse

Instance Method Details

#active_scaffold(model_id = nil, &block) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/active_scaffold/bridges/cancan/cancan_bridge.rb', line 26

def active_scaffold(model_id = nil, &block)
  super
  authorize_resource(
    :class => active_scaffold_config.model,
    :instance => :record
  )
end