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, ClassMethods, ModelUserAccess

Class Method Summary collapse

Methods inherited from DataStructures::Bridge

javascripts, run, stylesheets

Class Method Details

.installObject



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

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

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

.install?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/active_scaffold/bridges/cancan.rb', line 12

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