Load datamapper class methods via append_extensions.
This relaxes the previous requirement that cancan has to be loaded before any models are. append_extensions will apply to all previously loaded models as well as ones loaded after.
This commit is contained in:
parent
8f815c422a
commit
ccd7a94d40
|
@ -31,6 +31,4 @@ module CanCan
|
|||
end # module ModelAdapters
|
||||
end # module CanCan
|
||||
|
||||
DataMapper::Model.class_eval do
|
||||
include CanCan::ModelAdditions::ClassMethods
|
||||
end
|
||||
DataMapper::Model.append_extensions(CanCan::ModelAdditions::ClassMethods)
|
||||
|
|
Loading…
Reference in New Issue
Block a user