active_hash_relation 1.0.2 → 1.0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb48b886a8ace57b0562d7e40bc60a10daf7fde3
|
4
|
+
data.tar.gz: 6576b638fc3f6c21e5a3abfaa3d6329c7be6f8cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 626e25dd25e90c29a9360d986a8cfafa035ddc5822be42d38ada63ea61ab014b862f445db2ad68271cca1a2ecb2d8e519413a080b74bd2ecce8c12c772767bf9
|
7
|
+
data.tar.gz: 44c97841194c7df3b8e8bece218123b4f1e77db0edb42bd9d21a19269912e3f40c017734739271695f449166e8a63d5cb696b58166385f34bcc5d501b970815a
|
@@ -20,7 +20,12 @@ module ActiveHashRelation::ColumnFilters
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def filter_string(resource, column, table_name, param)
|
23
|
-
|
23
|
+
if param.is_a? Array
|
24
|
+
n_param = param.to_s.gsub("\"","'").gsub("[","").gsub("]","")
|
25
|
+
return resource = resource.where("#{table_name}.#{column} IN (#{n_param})")
|
26
|
+
else
|
27
|
+
return resource = resource.where("#{table_name}.#{column} ILIKE ?", "%#{param}%")
|
28
|
+
end
|
24
29
|
end
|
25
30
|
|
26
31
|
def filter_text(resource, column, param)
|
@@ -24,7 +24,8 @@ module ActiveHashRelation
|
|
24
24
|
end
|
25
25
|
table_name = @model.table_name
|
26
26
|
@model.columns.each do |c|
|
27
|
-
next if @params[c.name.to_s].
|
27
|
+
next if @params[c.name.to_s].nil?
|
28
|
+
next if @params[c.name.to_s].is_a?(String) && @params[c.name.to_s].blank?
|
28
29
|
|
29
30
|
if c.respond_to?(:primary)
|
30
31
|
if c.primary
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_hash_relation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filippos Vasilakis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-10-
|
12
|
+
date: 2015-10-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|