0.0
Low commit activity in last 3 years
No release in over a year
ActiveRecord provides no method for case insensitive version of `where` method. So here is one. No longer need to use SQL fragment yeah!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
>= 1.0.0
~> 0.5, >= 0.5.10
~> 3.0
~> 1.0
>= 1.3
>= 10.0, <= 14.0
>= 0.21

Runtime

>= 5.0.0, < 8.0.0
 Project Readme

where_lower

Provide an easy way to use case insensitive where in ActiveRecord.

Status

GitHub Build Status

Gem Version License

Coverage Status Code Climate Inch CI

The above badges are generated by https://shields.io/

Installation

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

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

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

record.association_records.where_lower('association_table.association_column' => value)

Contributors