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.
Files changed (3) hide show
  1. checksums.yaml +13 -5
  2. data/lib/search_me/search.rb +5 -3
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e03e90abe752238a9b064782fb565e89211f08f9
4
- data.tar.gz: bca62f59b49be643c18645eb4142468622be78af
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ Yjc1ZWM1YmI2NDgyMDYwNTMwOGVkODkzZmIxMjU4NGYzZWE3MWNiMw==
5
+ data.tar.gz: !binary |-
6
+ YzkzZTAxMDAzODA2NTRkYmNiYTViNmZhMTQzYTcwYzY4NjZjODI1OA==
5
7
  SHA512:
6
- metadata.gz: 96c8fb7d38c11eafc9d747fbc047c51163ec780247a1830d79238970805bc612b238da9586e10a1072fddfffd9f8a48bf606652fbbc508ee0c6a2485733396f1
7
- data.tar.gz: 5d4aa289de4ee421e8038ade3632108ac28c9717d16c4900751a230ea5306deb5bfc4bc3bf935a5aba84d78fbd9d9d5b325ab9423ec53576d452611a57d0efe1
8
+ metadata.gz: !binary |-
9
+ NDBhMTNiOTIwYWRiMzQ3ODJjZGQ2OTQ0NjBmZmJlYzBmMzMzYzQzOWUzNDli
10
+ ZTRjODQyODg3ZDgxNDAyY2U4NjRjODk3YWE4MGMzZWRhM2IxM2UwNGNlYmIz
11
+ MDJhMWRmNTFhNzdjZGQ3MzkwMzAyNjYyM2ZmZjdjMWM5MWZlODQ=
12
+ data.tar.gz: !binary |-
13
+ MmMxZGYxZjMxYmE5OGNmZTlhMTY4MTYxZGJiZTY0NWFkMzBkYmJkYzY4OGY3
14
+ YzllNTBkZmEyZTZmOWUxZDQzOWY1MGRlOGMwYzM4ODcwY2MxZmYwODEzNjgx
15
+ ODg2NmZlYzI1NDFlNjUzOWEwZmM1MTJkMzM5NmQ1ZGY5OGYxZmY=
@@ -123,11 +123,12 @@ module SearchMe
123
123
  self.advanced_search_reflection_group(type,search_terms) {
124
124
  |reflection,objs|
125
125
 
126
- f_key = "#{name_for(reflection.name)}_id"
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.7
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-03-31 00:00:00.000000000 Z
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: []