Skip to content
This repository

Require dm-core instead of data_mapper to detect DataMapper #372

Closed
wants to merge 1 commit into from

2 participants

Jacob Lukas Zachary Scott
Jacob Lukas

Requiring data_mapper pulls in unnecessary dependencies. All that's truly needed is dm-core and dm-aggregates (which is already required).

Zachary Scott
Collaborator
zzak commented August 06, 2013

This adds no extra value, some apps may already require the rest of data_mapper, so lets just leave it until the next major release.

We plan to refactor to gems.

Zachary Scott zzak closed this August 06, 2013
Jacob Lukas

The reason for this change is that one gem I require conflicts with dm-serializer, which data_mapper pulls in automatically. Changing this to requiring dm-core allows me to use kaminari.

Zachary Scott
Collaborator
zzak commented August 09, 2013

@jlukas can you show us your code, or a reproducible example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 26, 2013
Use dm-core instead of data_mapper to detect DataMapper 5f237b3
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/kaminari/hooks.rb
2  lib/kaminari/hooks.rb
@@ -6,7 +6,7 @@ def self.init
6 6
         ::ActiveRecord::Base.send :include, Kaminari::ActiveRecordExtension
7 7
       end
8 8
 
9  
-      begin; require 'data_mapper'; rescue LoadError; end
  9
+      begin; require 'dm-core'; rescue LoadError; end
10 10
       if defined? ::DataMapper
11 11
         require 'dm-aggregates'
12 12
         require 'kaminari/models/data_mapper_extension'
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.