corn_starch 1.2.6 → 1.2.7

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
  SHA1:
3
- metadata.gz: c828ebf43f7fd578515bf7b607046fdc2ebbb629
4
- data.tar.gz: ac611d2c60229b307445c989516e028e126aabb8
3
+ metadata.gz: e8b861eef819c096245fbca543346ea27b8fbf37
4
+ data.tar.gz: abbb4acce59ab11524526314d5b10e2639f57226
5
5
  SHA512:
6
- metadata.gz: ee0f30593a1e4b10e948e888026fecfb6f01d884acfd0268e84f6455f60b1812e241f82a125f8cbf8b02d9060a8665cf45a9a6b45bd1b9bee1ccae561a21a3e2
7
- data.tar.gz: 03f29bc0880b555b3834280138ec040c758b355da55c20c9165e76e52dcbc3335c9816dd852d20630bbefb510b715b27d47973441d04a6008112becd438b6206
6
+ metadata.gz: b7a32619d2d2900f9751854bf5ee6f0b92328176f3cc32d97dd1370d12dde0bfdac1eed034415b03c2ad12eaf1ba40976ed7b7da15f701defac16111c364ed2b
7
+ data.tar.gz: 81181019157a421560fd22b68fa239388143d6b216fa8b5900dd88aa93773f4a877d2e7bf3bef2207e08596fd29a4b0e157b4b2b4951c62efcebfc791d8ce33a
@@ -111,6 +111,7 @@ module CornStarch
111
111
  search_q = ''
112
112
  search_a = []
113
113
  search_fields = {}
114
+ first = true
114
115
 
115
116
  # Run through Model's Associations
116
117
  model.searchable_associations.each do |a|
@@ -129,23 +130,16 @@ module CornStarch
129
130
  search_fields[model.table_name] = []
130
131
  model.searchable_attributes.each { |a| search_fields[model.table_name] << a }
131
132
 
132
- puts "======== SEARCH FIELDS ===== #{search_fields.inspect}"
133
-
134
133
  # Run through Search Fields Models
135
134
  search_fields.each do |m, fields|
136
135
 
137
- # DEBUG
138
- puts "==== MODEL - [ #{m.inspect} ]"
139
-
140
136
  # Run through Model's Fields
141
137
  fields.each do |f|
142
138
 
143
- # DEBUG
144
- puts "==== FIELD - [ #{f.inspect} ]"
145
-
146
139
  # Build Search Query & Arguments Array
147
- search_q = search_q + "#{m}.#{f} LIKE ? "
140
+ search_q = search_q + (first ? '' : 'OR ') + "#{m}.#{f} LIKE ? "
148
141
  search_a << "%#{search}%"
142
+ first = false
149
143
  end
150
144
  end
151
145
 
@@ -1,3 +1,3 @@
1
1
  module CornStarch
2
- VERSION = '1.2.6'
2
+ VERSION = '1.2.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corn_starch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eresse