1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

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
This commit is contained in:
Cyril Mougel 2012-07-17 16:25:26 +02:00
parent 82a38e07db
commit ed77a2215b

View file

@ -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