kaminari divided by 0 error

When I try to use Hashie::Mash search query I get "divided by 0" error in kaminari paginate method