Sha256: ee362a9c0dabea7d2e77fee9017af076d3013976859f134ed370f9536cba8770
Contents?: true
Size: 1.61 KB
Versions: 1
Compression:
Stored size: 1.61 KB
Contents
# Date Supercharger A nice shortcut for date queries. `date_supercharger` adds `between`,`between_inclusive`,`_after`, `_after_or_at`, `_before` and `_before_or_at` methods to every date/datetime field of Active Record models. [![Build Status](https://travis-ci.org/simon0191/date_supercharger.svg)](https://travis-ci.org/simon0191/date_supercharger) [![Code Climate](https://codeclimate.com/github/simon0191/date_supercharger/badges/gpa.svg)](https://codeclimate.com/github/simon0191/date_supercharger) [![Test Coverage](https://codeclimate.com/github/simon0191/date_supercharger/badges/coverage.svg)](https://codeclimate.com/github/simon0191/date_supercharger/coverage) ## Usage ```ruby Visit.created_at_between(from,to) ``` instead of ```ruby Visit.where("created_at >= ? AND created_at < ?",from,to) ``` ```ruby Visit.created_at_between_inclusive(from,to) ``` instead of ```ruby Visit.where("created_at >= ? AND created_at <= ?",from,to) ``` ```ruby Visit.created_at_after(some_date) ``` instead of ```ruby Visit.where("created_at > ?",some_date) ``` ## Installation Add this line to your application’s Gemfile: ```ruby gem 'date_supercharger' ``` And then execute: ```sh bundle ``` ## History View the [changelog](https://github.com/simon0191/date_supercharger/blob/master/CHANGELOG.md) ## Contributing Everyone is encouraged to help improve this project. Here are a few ways you can help: - [Report bugs](https://github.com/simon0191/date_supercharger/issues) - Fix bugs and [submit pull requests](https://github.com/simon0191/date_supercharger/pulls) - Write, clarify, or fix documentation - Suggest or add new features
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
date_supercharger-0.1.1 | README.md |