Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6467811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:49:52+00:00 2026-05-25T05:49:52+00:00

I have 2 stored procedures wich return data with limit and offset and count

  • 0

I have 2 stored procedures wich return data with limit and offset and count of all records.
How can I use Kaminari for pagination in this case ?

UPD
I have problem with kaminari in edge version! I have abstract class MyRecord extended from ActiveRecord, other models extends this abstract class.

class Customer < MyRecord
has_one :active_order, :class_name => 'Order', 
:conditions => {
:status_type => [Order::STATUS_TYPES[:active],Order::STATUS_TYPES[:paused]]
}

…….

controller

 @customers = Customer.search(params[:search]).includes(:active_order).order(sort_column + ' ' + sort_direction).page(params[:page]).per(25)

I get now wrong query (abstract class table name instead of model table name)

  SELECT `my_records`.* FROM `my_records` WHERE 
        (`my_records`.customer_id IN (160,161,162,163,164,165,166,167,168,169,170) 
    AND (`my_records`.`status_type` IN (0, 2)))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T05:49:52+00:00Added an answer on May 25, 2026 at 5:49 am

    Just added a new feature on Kaminari::PaginatableArray that would solve your problem.
    https://github.com/amatsuda/kaminari/pull/141

    Can you bundle the edge version of Kaminari:

    gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari'
    

    and pass :total_count option to PaginatableArray#new like this?

    Kaminari::PaginatableArray.new(array, :total_count => 1326).page(5)
    

    or

    Kaminari::PaginatableArray.new(array, :total_count => 9999, :limit => 10, :offset => 30)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have two stored procedures in Microsoft SQL Server that return data that is
I have some stored procedures to execute that use dbms_output.put_line() to put data into
I have several stored procedures that all use the same set of parameters. Is
I have two stored procedures I wish to use in my stored procedure, but
I have some complex stored procedures that may return many thousands of rows, and
We have lots of stored procedures which all contain a lot of comments. Is
I have 500 stored procedures in a Sybase database. Using SQL, can I get
I have several stored procedures which return a strongly typed result set. I've learned
I have sybase stored procedures that I have written which we use in our
I have stored procedures (they accept parameters) that return multiple result sets and I'd

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.