New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kkantena-progress_adapter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kkantena-progress_adapter

  • 1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

KANTENA Paris France May 2009

1 - Purpose

PROGRESS ADAPTER is for use when DBMS engine doesn't support LIMIT and OFFSET SQL instructions, as PROGRESS DBMS don't (until v 10.2 ). With such DBMS and rails you load all records and instantiate each object for , which can be such longer ! Tough , no pagination is possible . With this ProgressAdapter module , you easily can !

2 - Install

Install plugin : script/plugin git://github.com/kkantena/progress_adapter.git

3 - Use it !

Add "include ProgressAdapter" in models where you need it.

You can use ActiveRecord::Base.find as usual , and can now pass two more keys : :page => :per_page => < number of object instanciation records you want>

To get number of records : number_of_records method To get number of pages : number_of_pages method

Example :

class Foo < ActiveRecord::Base include ProgressAdapter

def list list = find :all , :page => 4 , :per_page => 10 nb_records = number_of_records nb_pages = number_of_pages [nb_records,nb_pages,list] end end

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc