mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
Extract kaminari-mongo_mapper gem, and warn users to use the gemified adapter
The built-in MongoMapper support will be removed from this gem in the 1.0 release
This commit is contained in:
parent
6f7f315c70
commit
e6d847b281
1 changed files with 9 additions and 3 deletions
|
|
@ -27,10 +27,16 @@ module Kaminari
|
|||
end
|
||||
end
|
||||
|
||||
## mongo_mapper
|
||||
ActiveSupport.on_load(:mongo_mapper) do
|
||||
require 'kaminari/models/mongo_mapper_extension'
|
||||
::MongoMapper::Document.send :include, Kaminari::MongoMapperExtension::Document
|
||||
::Plucky::Query.send :include, Kaminari::PluckyCriteriaMethods
|
||||
begin
|
||||
require 'kaminari/mongo_mapper'
|
||||
rescue LoadError
|
||||
ActiveSupport::Deprecation.warn p('Kaminari MongoMapper support has been extracted to a separate gem, and will be removed in the next 1.0 release. Please bundle kaminari-mongo_mapper gem.')
|
||||
require 'kaminari/models/mongo_mapper_extension'
|
||||
::MongoMapper::Document.send :include, Kaminari::MongoMapperExtension::Document
|
||||
::Plucky::Query.send :include, Kaminari::PluckyCriteriaMethods
|
||||
end
|
||||
end
|
||||
require 'kaminari/models/array_extension'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue