Skip to content

Commit

Permalink
Load datamapper class methods via append_extensions.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
psanford committed Jul 1, 2011
1 parent 8f815c4 commit ccd7a94
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/cancan/model_adapters/data_mapper_adapter.rb
Expand Up @@ -31,6 +31,4 @@ def database_records
end # module ModelAdapters
end # module CanCan

DataMapper::Model.class_eval do
include CanCan::ModelAdditions::ClassMethods
end
DataMapper::Model.append_extensions(CanCan::ModelAdditions::ClassMethods)

0 comments on commit ccd7a94

Please sign in to comment.