Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Load datamapper class methods via append_extensions. #410

Merged
merged 1 commit into from

2 participants

@psanford

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.

@psanford psanford 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.
ccd7a94
@ryanb ryanb merged commit 600a3e1 into ryanb:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 1, 2011
  1. @psanford

    Load datamapper class methods via append_extensions.

    psanford authored
    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 page is out of date. Refresh to see the latest.
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/cancan/model_adapters/data_mapper_adapter.rb
View
4 lib/cancan/model_adapters/data_mapper_adapter.rb
@@ -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)
Something went wrong with that request. Please try again.