Skip to content

Commit

Permalink
require 'dm-aggregates' in DataMapper hook
Browse files Browse the repository at this point in the history
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 kaminari#220
  • Loading branch information
shingara committed Jul 17, 2012
1 parent 82a38e0 commit ed77a22
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/kaminari/hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def self.init

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
Expand Down

0 comments on commit ed77a22

Please sign in to comment.