activerecord-filter 6.1.0 → 6.1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29fb0cf2e61a150f0ea6aaa4877961ccd58008daeb7af2bb9766f726f9b37e46
4
- data.tar.gz: 7492a6050879102efac043637217972388f607af7c62a3b4a176b04d7695ea9b
3
+ metadata.gz: 15ee3eb761b9e63875afecd98becf6b5f6b0482937610ee0a9303cfe7d8d0b75
4
+ data.tar.gz: 85b0b14cee45da61b44326810765078ad7a838af806168950a0ee50d48b5a2c6
5
5
  SHA512:
6
- metadata.gz: 9c2f00f35c2eeff0a93866024fbacaf5a24f14843d82ccf81e5b0eefb36918a3892424c00a3b5f01d8f42f176e63331b3ca90fb54be388900517572be44857d9
7
- data.tar.gz: e3bd52216a2cbd41e9769cf7b813a5b69af63f03c45a7616e7cb0eea444711f746fd8a1bcb7b377b5b8c604463c011263f802473db072990d7a1559590c06e0d
6
+ metadata.gz: b6f47b5bc745550bb48c1cd6aa85642e20511b5235befe0acd123909e0faa422c2b53662a26e8db4da8ae44029b0d0ddf44fd5179e48f23ee25e3463634bc164
7
+ data.tar.gz: 2240aadf3eea6b58f1b2d16e7e0cb785e7250938538533bf33d565871a15d845f0a1ea496cdec8b520bc575c66f330953dd300eabc1d75be405c029468e19124
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # ActiveRecord::filter
1
+ # ActiveRecord::Filter
2
2
 
3
- `ActiveRecord::filter` provides and easy way to accept user input and filter a query by the input.
3
+ `ActiveRecord::Filter` provides and easy way to accept user input and filter a query by the input.
4
4
 
5
5
  Installtion
6
6
  -----------
@@ -73,6 +73,9 @@ String columns:
73
73
  Property.filter(name: {like: 'nam%'}).to_sql
74
74
  # => "... WHERE properties.name LIKE 'nam%' ..."
75
75
 
76
+ Property.filter(name: {ilike: 'nam%'}).to_sql
77
+ # => "... WHERE properties.name ILIKE 'nam%' ..."
78
+
76
79
  Property.filter(name: {ts_match: 'name'}).to_sql
77
80
  # => "... WHERE to_tsvector("properties"."name") @@ to_tsquery('name') ..."
78
81
  ```
@@ -125,6 +128,6 @@ It can also sort on relations:
125
128
 
126
129
  ```ruby
127
130
  Photo.filter(property: {name: 'Empire State'}).to_sql
128
- # => "... INNER JOIN properties ON properties.id = photos.property_id ...
131
+ # => "... LEFT OUTER JOIN properties ON properties.id = photos.property_id ...
129
132
  # => "... WHERE properties.name = 'Empire State'"
130
- ```
133
+ ```
@@ -257,8 +257,10 @@ module ActiveRecord
257
257
  attribute.lt(value)
258
258
  when :less_than_or_equal_to, :lteq, :lte
259
259
  attribute.lteq(value)
260
- when :like, :ilike
261
- attribute.matches(value)
260
+ when :like
261
+ attribute.matches(value, nil, true)
262
+ when :ilike
263
+ attribute.matches(value, nil, false)
262
264
  when :not, :not_equal, :neq
263
265
  attribute.not_eq(value)
264
266
  when :not_in
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Filter
3
- VERSION = '6.1.0'
3
+ VERSION = '6.1.0.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 6.1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-14 00:00:00.000000000 Z
11
+ date: 2021-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 6.1.0.rc2
33
+ version: 6.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 6.1.0.rc2
40
+ version: 6.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pg
43
43
  requirement: !ruby/object:Gem::Requirement