0.0
No commit activity in last 3 years
No release in over 3 years
SQLf
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 0.8.0
~> 10.0
>= 3.2.0, ~> 3.2
>= 0.8.0, ~> 0.8.7

Runtime

>= 4.0.0, ~> 4.0
>= 4.0.0, ~> 4.0
>= 4.0.0, ~> 4.0
 Project Readme

FuzzyWhere

Gem Version Build Status Code Climate Coverage Status

An ActiveRecord implementation of SQLf. At this moment it allows you to load fuzzy definitions from a yaml file and use them as WHERE conditions. More features from SQLf will be added to this gem in future iterations.

Installation

Add this line to your application's Gemfile:

gem 'fuzzy_where'

And then execute:

bundle

Or install it yourself as:

gem install fuzzy_where

Finally generate the configuration files:

rails generate fuzzy_where:config

Usage

Fuzzy predicates are stored in config/fuzzy_predicates.yml. You can use a generator to populate this file.

rails generate fuzzy_where:predicate PREDICATE min core1 core2 max

Replace PREDICATE with the name you wish to use for you linguistic expression and set the values for the trapezoid function.

Example:

rails generate fuzzy_where:predicate young 10 15 20 25

Will produce:

# config/fuzzy_predicates.yml
young:
  min: 10
  core1: 15
  core2: 20
  max: 25

Then you can use your definitions as follows:

Person.fuzzy_where(age: :young)

Contributing

  1. Fork it ( https://github.com/koombea/fuzzy_where/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

MIT License. Copyright 2015-2016 Koombea. http://koombea.com