Class: ActiveScaffold::Bridges::Cancan

Inherits:
DataStructures::Bridge show all
Defined in:
lib/active_scaffold/bridges/cancan.rb,
lib/active_scaffold/bridges/cancan/cancan_bridge.rb

Defined Under Namespace

Modules: Actions, ActiveRecord, AssociationHelpers, ClassMethods, ModelUserAccess

Class Method Summary collapse

Methods inherited from DataStructures::Bridge

javascripts, prepare, run, stylesheets

Class Method Details

.installObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/active_scaffold/bridges/cancan.rb', line 2

def self.install
  require File.join(File.dirname(__FILE__), 'cancan', 'cancan_bridge.rb')

  ActiveScaffold::Core::ClassMethods.send :prepend, ActiveScaffold::Bridges::Cancan::ClassMethods
  ActiveScaffold::Actions::Core.send :prepend, ActiveScaffold::Bridges::Cancan::Actions::Core
  ActiveScaffold::Actions::Nested.send :prepend, ActiveScaffold::Bridges::Cancan::Actions::Core
  ActionController::Base.send :include, ActiveScaffold::Bridges::Cancan::ModelUserAccess::Controller
  ActionView::Base.send :include, ActiveScaffold::Bridges::Cancan::AssociationHelpers
  ::ActiveRecord::Base.send :include, ActiveScaffold::Bridges::Cancan::ModelUserAccess::Model
  ::ActiveRecord::Base.send :include, ActiveScaffold::Bridges::Cancan::ActiveRecord
end

.install?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/active_scaffold/bridges/cancan.rb', line 14

def self.install?
  Object.const_defined? 'CanCan'
end