forest_liana 1.3.8 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3f269c44df72a078642f38b64d6c37618aba66c
4
- data.tar.gz: 60a01c896b274cbf2e04500265a770dc64f57e15
3
+ metadata.gz: 0fcc2d35edd3cfc880c45eb6646849e36460cb53
4
+ data.tar.gz: 878a55c940309577ac7502633595f78cff0ebd44
5
5
  SHA512:
6
- metadata.gz: 43df1a42630933a5331be794243457bfc05591559ff0209749b6e2ffd0d59a9b1944f4921c7fda47fb0748a4edc1fda0771bf86cb9b16944a225135cc9fbf266
7
- data.tar.gz: 709f41288142a88b1fc02afd8db7b1e4987796f34fb73076a612f1b99052ce3f46ec7caa108d27118684d0811d93fee663c57c6f9312977d487b94b602cb69fe
6
+ metadata.gz: 5fe5680f536cdc2896232d996ba0249c78e63df09a6ccbd2f30d48a050ce1adcc15196b8341372fd115c5c55261c42db4ee87d0afa713b314d5f748fc0ee8115
7
+ data.tar.gz: 1986c32ec3992a45477c161ef86d3af0e75127c4dfa54d2befd30369a8817904094b26f9c84a52a367dab3ea332fc56a3314607582aefd7b83ade8c50713ba2a
@@ -30,6 +30,18 @@ module ForestLiana
30
30
  end
31
31
  end
32
32
 
33
+ SchemaUtils.one_associations(@resource).map(&:name).each do |association|
34
+ resource = @resource.reflect_on_association(association.to_sym)
35
+ resource.klass.columns.each do |column|
36
+ if !column.array && (column.type == :string || column.type == :text)
37
+ conditions <<
38
+ "\"#{resource.table_name}\".\"#{column.name}\" ILIKE " +
39
+ "'%#{@params[:search].downcase}%'"
40
+ end
41
+ end
42
+ @resource = @resource.joins(association.to_sym)
43
+ end
44
+
33
45
  @records = @resource.where(conditions.join(' OR '))
34
46
  end
35
47
 
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "1.3.8"
2
+ VERSION = "1.3.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8
4
+ version: 1.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-14 00:00:00.000000000 Z
11
+ date: 2016-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails