Sha256: 3d108fc41489fe17f8d4261ad065d151f8569b7800e90c8b144c65006b73b42b
Contents?: true
Size: 1.66 KB
Versions: 1
Compression:
Stored size: 1.66 KB
Contents
# where_lower Provide an easy way to use case insensitive `where` in ActiveRecord. ## Status [](https://travis-ci.org/PikachuEXE/where_lower) [](http://badge.fury.io/rb/where_lower) [](https://coveralls.io/r/PikachuEXE/where_lower) [](https://codeclimate.com/github/PikachuEXE/where_lower/maintainability) [](https://inch-ci.org/github/PikachuEXE/where_lower) ## Installation ```ruby gem 'where_lower' ``` ## Usage Supports `String`, `Array`, `Range` Values in `Array` and `Range` will be converted to `String` and then `downcase` Other types will not be touched ```ruby SomeActiveRecordClass.where_lower(attribute1: 'AbC', attribute2: ['stRing', 123, :symBol], attribute3: ('AA'..'AZ')) ``` ### Since `0.3.0` You can pass a nested hash (1 level deep only) for association condition ```ruby record.association_records.where_lower(association_table: {association_column: value}) ``` You can also add table name in key if you are using it with association I don't plan to support any "smart" table guessing though ```ruby record.association_records.where_lower('association_table.association_column' => value) ``` ## Contributors - [Matthew Rudy Jacobs](https://github.com/matthewrudy) (Who wrote the first version of `where_lower` method)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
where_lower-0.3.3 | README.md |