Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1006 Bytes

README.md

File metadata and controls

39 lines (30 loc) · 1006 Bytes

FuzzyDates

Fuzzy Dates is designed to store date values within a specified amount of accuracy. Each date is stored as a range and a descriptor, so that programmatic operations can still be performed, while providing a user-friendly label.

Installation

Add this line to your application's Gemfile:

gem "fuzzy_dates"

And then execute:

$ bundle install

Or install it yourself as:

$ gem install fuzzy_dates

Usage

class MyModel < ApplicationRecord
  include FuzzyDates::FuzzyDateable
  
  has_fuzzy_dates :start_date, :end_date
end
class MyModelsSerializer < BaseSerializer
  index_attributes :id, :name, start_date: FuzzyDates::FuzzyDateSerializer, end_date: FuzzyDates::FuzzyDateSerializer
  show_attributes :id, :name, start_date: FuzzyDates::FuzzyDateSerializer, end_date: FuzzyDates::FuzzyDateSerializer
end

License

The gem is available as open source under the terms of the MIT License.