Code Monkey home page Code Monkey logo

kaminari-mongoid's Issues

scope override errore when used with sublcasses

Hello,

our app has a class which includes Mongoid::Document and many subclasses.
the following exception is thrown Mongoid::Errors::ScopeOverwrite when kaminari-mongoid attempts to add page scope to each of the subclasses (file mongoid_extensions:12)

mongoid 4.0.2
kaminari master
kaminari-mongoid master

uninitialized constant Kaminari::Mongoid::VERSION (NameError)

I just moved from 0.16.x to the last github version in order to have the new params_on_first_page config.

I use the last versions from https://github.com/amatsuda/kaminari and https://github.com/kaminari/kaminari-mongoid and got this error on server start:

....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/kaminari-mongoid-0.1.1/lib/kaminari/mongoid/mongoid_extension.rb:24:in `<module:Document>': uninitialized constant Kaminari::Mongoid::VERSION (NameError)
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/kaminari-mongoid-0.1.1/lib/kaminari/mongoid/mongoid_extension.rb:6:in `<module:MongoidExtension>'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/kaminari-mongoid-0.1.1/lib/kaminari/mongoid/mongoid_extension.rb:5:in `<module:Mongoid>'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/kaminari-mongoid-0.1.1/lib/kaminari/mongoid/mongoid_extension.rb:4:in `<module:Kaminari>'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/kaminari-mongoid-0.1.1/lib/kaminari/mongoid/mongoid_extension.rb:3:in `<top (required)>'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/kaminari-mongoid-0.1.1/lib/kaminari/mongoid.rb:3:in `require'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/kaminari-mongoid-0.1.1/lib/kaminari/mongoid.rb:3:in `<top (required)>'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:100:in `require'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:100:in `rescue in block in require'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:77:in `block in require'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
    from ......config/application.rb:17:in `<top (required)>'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in `require'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in `block in server'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `tap'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `server'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
    from .../...bin/rails:8:in `require'
    from ......bin/rails:8:in `<top (required)>'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `load'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `call'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.4/lib/spring/client/command.rb:7:in `call'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.4/lib/spring/client.rb:28:in `run'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.4/bin/spring:49:in `<top (required)>'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `load'
    from ....rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `<top (required)>'
    from ....rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from ....rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from .../...bin/spring:13:in `<top (required)>'
    from .../...bin/rails:3:in `load'
    from .../...bin/rails:3:in `<top (required)>'
    from -e:1:in `load'
    from -e:1:in `<main>'

Thanks

Incorrect count for paginated results

See below example:

#controller
@templates = Template.where(read_conditions).order_by(updated: :desc).page(params[:page]).per(params[:per_page]) # does not matter if per_page is supplied or nil
(byebug) @templates[5]
nil
(byebug) @templates.count
8
(byebug) @templates.entries.count
5
(byebug) @templates.entries.size
5
(byebug) @templates.class
Mongoid::Criteria

for @templates[0] .. @templates[4] there are values.

undefined method `paginate' error

Just updated to new kaminari and got this error.

I have replaced 'kaminari' with 'kaminari-mongoid' in gemfile und updated bundle.

Back to 0.17.0 for now.

by
TheR

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.