Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noredink/first_after_created_at
https://github.com/noredink/first_after_created_at
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/noredink/first_after_created_at
- Owner: NoRedInk
- License: mit
- Created: 2017-07-21T13:53:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T19:56:46.000Z (almost 2 years ago)
- Last Synced: 2024-05-08T23:24:56.710Z (8 months ago)
- Language: Ruby
- Size: 109 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: MIT-LICENSE
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'))
=> #