Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/noredink/first_after_created_at


https://github.com/noredink/first_after_created_at

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# FirstAfterCreatedAt, a tool for using binary search to search by created_at.
[![Build Status](https://travis-ci.org/NoRedInk/first_after_created_at.svg?branch=master)](https://travis-ci.org/NoRedInk/first_after_created_at)

Assuming you have an autoincrimenting primary key `id` and a id-sorted `created_at` column, you can use this gem to quickly search for items by time.

## Installation

Add this line to your application's Gemfile:

```Gemfile
gem 'first_after_created_at'
```

And then execute:
```shell
$ bundle
```

Or install it yourself as:

```shell
$ gem install first_after_created_at
```

## Usage

```ruby
ModelName.first_after_created_at(Time.parse('2017-01-01'))
=> #