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:
psanford 2011-07-01 12:48:20 -07:00
parent 8f815c422a
commit ccd7a94d40

View File

@ -31,6 +31,4 @@ module CanCan
end # module ModelAdapters end # module ModelAdapters
end # module CanCan end # module CanCan
DataMapper::Model.class_eval do DataMapper::Model.append_extensions(CanCan::ModelAdditions::ClassMethods)
include CanCan::ModelAdditions::ClassMethods
end