lato 3.8.0 → 3.8.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: 48e75667276e436c09b94d35948a806ab647a3bd712715640028ebe5e902885d
4
- data.tar.gz: 6cf22a820de4c125565a45d8b5d0c4a44cb4b063e97e544ac7c304312d8f8cae
3
+ metadata.gz: d798ee21a2e9f1ebb6667f39ce4de775fa45ab1e4f31769dadf7699ed3bc902c
4
+ data.tar.gz: 60876444bb2a4c459913b529c333b1053890c9289875b58ac9167a8909c5c821
5
5
  SHA512:
6
- metadata.gz: 3df8293c4c8d0893b9ecdebb51f879f2c4dc4637e30b28b3d01f4e98f823835a4176476240479d9c825e74d558794086573f06e70bc5ece640a31f6135576eda
7
- data.tar.gz: df5974cd8bb80e71814bb50b855dc7bcede9368d69a4f1c671d8a1773eb062d963955d45ad4a4b02cde4cac3affef9573bf66f9afe9e5db89bc2947b4968d1a4
6
+ metadata.gz: 5c14287d5f9366e89a72c4b3c8a7849567218fe143899a3dffe30128f51247831d25834a95dfe6757c2665ff301d0daf0553fae6f6e131efb2f3fea9cf64c351
7
+ data.tar.gz: 35a7b17307b370392d54be93cdf509b480f4901dc3a45f4ca37bcba50cb3109dbc5f5daf6fd4138cd3a41d27cdec8062dddc296a30d644cf6bc8088f273ffbbf
@@ -37,7 +37,13 @@ module Lato
37
37
  if collection.respond_to?(:lato_index_search)
38
38
  collection = collection.lato_index_search(search)
39
39
  else
40
- query = @_lato_index[key][:searchable_columns].map { |k| "#{k.to_s == 'id' ? k : "lower(#{k})"} LIKE :search" }
40
+ query = @_lato_index[key][:searchable_columns].map do |key|
41
+ if collection.column_for_attribute(key).type == :string
42
+ "LOWER(#{key}) LIKE :search"
43
+ else
44
+ "CAST(#{key} AS TEXT) LIKE :search"
45
+ end
46
+ end
41
47
  collection = collection.where(query.join(' OR '), search: "%#{search.downcase.strip}%")
42
48
  end
43
49
  end
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "3.8.0"
2
+ VERSION = "3.8.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-06 00:00:00.000000000 Z
11
+ date: 2024-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails