turning into a funtioning Rails plugin

This commit is contained in:
Ryan Bates 2009-11-16 19:24:04 -08:00
parent 1034c81763
commit aaed265c91
3 changed files with 11 additions and 9 deletions

1
init.rb Normal file
View File

@ -0,0 +1 @@
require 'cancan'

View File

@ -1,8 +1,7 @@
$:.unshift(File.dirname(__FILE__))
require 'cancan/instance_exec'
require 'cancan/ability'
require 'cancan/controller_additions'
module CanCan module CanCan
class AccessDenied < StandardError; end class AccessDenied < StandardError; end
end end
require File.dirname(__FILE__) + '/cancan/instance_exec'
require File.dirname(__FILE__) + '/cancan/ability'
require File.dirname(__FILE__) + '/cancan/controller_additions'

View File

@ -35,6 +35,8 @@ module CanCan
end end
end end
class ActionController::Base if defined? ActionController
include CanCan::ControllerAdditions ActionController::Base.class_eval do
include CanCan::ControllerAdditions
end
end end