search_me 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/search_me/search.rb +5 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
Yjc1ZWM1YmI2NDgyMDYwNTMwOGVkODkzZmIxMjU4NGYzZWE3MWNiMw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzkzZTAxMDAzODA2NTRkYmNiYTViNmZhMTQzYTcwYzY4NjZjODI1OA==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NDBhMTNiOTIwYWRiMzQ3ODJjZGQ2OTQ0NjBmZmJlYzBmMzMzYzQzOWUzNDli
|
10
|
+
ZTRjODQyODg3ZDgxNDAyY2U4NjRjODk3YWE4MGMzZWRhM2IxM2UwNGNlYmIz
|
11
|
+
MDJhMWRmNTFhNzdjZGQ3MzkwMzAyNjYyM2ZmZjdjMWM5MWZlODQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MmMxZGYxZjMxYmE5OGNmZTlhMTY4MTYxZGJiZTY0NWFkMzBkYmJkYzY4OGY3
|
14
|
+
YzllNTBkZmEyZTZmOWUxZDQzOWY1MGRlOGMwYzM4ODcwY2MxZmYwODEzNjgx
|
15
|
+
ODg2NmZlYzI1NDFlNjUzOWEwZmM1MTJkMzM5NmQ1ZGY5OGYxZmY=
|
data/lib/search_me/search.rb
CHANGED
@@ -123,11 +123,12 @@ module SearchMe
|
|
123
123
|
self.advanced_search_reflection_group(type,search_terms) {
|
124
124
|
|reflection,objs|
|
125
125
|
|
126
|
-
|
126
|
+
many_f_key = "#{name_for(reflection.name)}_id"
|
127
|
+
self_f_key = "#{name_for(self)}_id"
|
127
128
|
related = through_klass_for_reflection(reflection)
|
128
129
|
.where(f_key => objs.ids)
|
129
130
|
|
130
|
-
"id IN (#{object_ids(related).join(',')})"
|
131
|
+
"id IN (#{object_ids(related, self_f_key).join(',')})"
|
131
132
|
}
|
132
133
|
end
|
133
134
|
}
|
@@ -161,10 +162,11 @@ module SearchMe
|
|
161
162
|
warn 'WARNING: has_many_through in development'
|
162
163
|
self.search_reflection_group(type, term) { |reflection,objs|
|
163
164
|
f_key = "#{name_for(reflection.name)}_id"
|
165
|
+
self_f_key = "#{name_for(self)}_id"
|
164
166
|
related = through_klass_for_reflection(reflection)
|
165
167
|
.where(f_key => objs.ids)
|
166
168
|
|
167
|
-
"id IN (#{object_ids(related).join(',')})"
|
169
|
+
"id IN (#{object_ids(related, self_f_key).join(',')})"
|
168
170
|
}
|
169
171
|
end
|
170
172
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: search_me
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jphager2
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Uses LIKE to search attributes and return any objects of the model for
|
14
14
|
which a match is found
|
@@ -31,12 +31,12 @@ require_paths:
|
|
31
31
|
- lib
|
32
32
|
required_ruby_version: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- -
|
34
|
+
- - ! '>='
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: '0'
|
37
37
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ! '>='
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
requirements: []
|