From ed77a2215bab4469e40d388b5209f5cc1ded0fcb Mon Sep 17 00:00:00 2001 From: Cyril Mougel Date: Tue, 17 Jul 2012 16:25:26 +0200 Subject: [PATCH] require 'dm-aggregates' in DataMapper hook To work fine Kaminari need dm-aggregates so it's better to require it if the DataMapper extension is active to be sure this gem is install in runtime and can avoid some issue see #220 --- lib/kaminari/hooks.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/kaminari/hooks.rb b/lib/kaminari/hooks.rb index 514ae7f..d330d31 100644 --- a/lib/kaminari/hooks.rb +++ b/lib/kaminari/hooks.rb @@ -8,6 +8,7 @@ module Kaminari begin; require 'data_mapper'; rescue LoadError; end if defined? ::DataMapper + require 'dm-aggregates' require 'kaminari/models/data_mapper_extension' ::DataMapper::Collection.send :include, Kaminari::DataMapperExtension::Collection ::DataMapper::Model.append_extensions Kaminari::DataMapperExtension::Model