BACKWARDS INCOMPATIBLE: use Ability#initialize instead of 'prepare' to set up abilities - closes #4

This commit is contained in:
Ryan Bates
2009-11-17 10:25:47 -08:00
parent 9d58226563
commit 1edf583110
6 changed files with 17 additions and 20 deletions

View File

@@ -47,9 +47,5 @@ module CanCan
:update => [:edit],
}
end
def prepare(user)
# to be overriden by included class
end
end
end

View File

@@ -9,9 +9,7 @@ module CanCan
end
def current_ability
ability = ::Ability.new
ability.prepare(current_user)
ability
::Ability.new(current_user)
end
def can?(*args)
@@ -43,4 +41,4 @@ if defined? ActionController
ActionController::Base.class_eval do
include CanCan::ControllerAdditions
end
end
end