pg_search 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = PgSearch
2
2
 
3
+ == 0.6.4
4
+
5
+ * Fix issue with using more than two features in the same scope
6
+
3
7
  == 0.6.3
4
8
 
5
9
  * Fix issues and deprecations for Active Record 4.0.0.rc1
@@ -36,8 +36,8 @@ module PgSearch
36
36
  config.features.map do |feature_name, feature_options|
37
37
  feature_for(feature_name).conditions
38
38
  end.inject do |accumulator, expression|
39
- Arel::Nodes::Or.new(accumulator, expression).to_sql
40
- end
39
+ Arel::Nodes::Or.new(accumulator, expression)
40
+ end.to_sql
41
41
  end
42
42
 
43
43
  def order_within_rank
@@ -1,3 +1,3 @@
1
1
  module PgSearch
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
@@ -564,6 +564,13 @@ describe "an Active Record model which includes PgSearch" do
564
564
  :trigram
565
565
  ]
566
566
 
567
+ ModelWithPgSearch.pg_search_scope :complex_search,
568
+ :against => [:content, :title],
569
+ :using => {
570
+ :tsearch => {:dictionary => 'english'},
571
+ :dmetaphone => {},
572
+ :trigram => {}
573
+ }
567
574
  end
568
575
 
569
576
  it "returns rows that match using any of the features" do
@@ -574,12 +581,21 @@ describe "an Active Record model which includes PgSearch" do
574
581
  ModelWithPgSearch.with_trigram(trigram_query).should include(record)
575
582
  ModelWithPgSearch.with_tsearch(trigram_query).should_not include(record)
576
583
  ModelWithPgSearch.with_tsearch_and_trigram(trigram_query).should == [record]
584
+ ModelWithPgSearch.complex_search(trigram_query).should include(record)
577
585
 
578
586
  # matches tsearch only
579
587
  tsearch_query = "tiles"
580
588
  ModelWithPgSearch.with_tsearch(tsearch_query).should include(record)
581
589
  ModelWithPgSearch.with_trigram(tsearch_query).should_not include(record)
582
590
  ModelWithPgSearch.with_tsearch_and_trigram(tsearch_query).should == [record]
591
+ ModelWithPgSearch.complex_search(tsearch_query).should include(record)
592
+
593
+ # matches dmetaphone only
594
+ dmetaphone_query = "tyling"
595
+ ModelWithPgSearch.with_tsearch(dmetaphone_query).should_not include(record)
596
+ ModelWithPgSearch.with_trigram(dmetaphone_query).should_not include(record)
597
+ ModelWithPgSearch.with_tsearch_and_trigram(dmetaphone_query).should_not include(record)
598
+ ModelWithPgSearch.complex_search(dmetaphone_query).should include(record)
583
599
  end
584
600
 
585
601
  context "with feature-specific configuration" do
metadata CHANGED
@@ -1,151 +1,162 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: pg_search
3
- version: !ruby/object:Gem::Version
4
- version: 0.6.3
3
+ version: !ruby/object:Gem::Version
4
+ hash: 15
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 6
9
+ - 4
10
+ version: 0.6.4
5
11
  platform: ruby
6
- authors:
12
+ authors:
7
13
  - Grant Hutchins
8
14
  - Case Commons, LLC
9
15
  autorequire:
10
16
  bindir: bin
11
17
  cert_chain: []
12
- date: 2013-05-12 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
18
+
19
+ date: 2013-05-26 00:00:00 Z
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
15
22
  name: activerecord
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - '>='
19
- - !ruby/object:Gem::Version
20
- version: '3.1'
21
- type: :runtime
22
23
  prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - '>='
26
- - !ruby/object:Gem::Version
27
- version: '3.1'
28
- - !ruby/object:Gem::Dependency
29
- name: activesupport
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - '>='
33
- - !ruby/object:Gem::Version
34
- version: '3.1'
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 5
30
+ segments:
31
+ - 3
32
+ - 1
33
+ version: "3.1"
35
34
  type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: activesupport
36
38
  prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - '>='
40
- - !ruby/object:Gem::Version
41
- version: '3.1'
42
- - !ruby/object:Gem::Dependency
43
- name: arel
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - '>='
47
- - !ruby/object:Gem::Version
48
- version: '0'
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 5
45
+ segments:
46
+ - 3
47
+ - 1
48
+ version: "3.1"
49
49
  type: :runtime
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: arel
50
53
  prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - '>='
54
- - !ruby/object:Gem::Version
55
- version: '0'
56
- - !ruby/object:Gem::Dependency
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ hash: 3
60
+ segments:
61
+ - 0
62
+ version: "0"
63
+ type: :runtime
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
57
66
  name: rake
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - '>='
61
- - !ruby/object:Gem::Version
62
- version: '0'
63
- type: :development
64
67
  prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
- - !ruby/object:Gem::Dependency
71
- name: rdoc
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - '>='
75
- - !ruby/object:Gem::Version
76
- version: '0'
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ hash: 3
74
+ segments:
75
+ - 0
76
+ version: "0"
77
77
  type: :development
78
+ version_requirements: *id004
79
+ - !ruby/object:Gem::Dependency
80
+ name: rdoc
78
81
  prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - '>='
82
- - !ruby/object:Gem::Version
83
- version: '0'
84
- - !ruby/object:Gem::Dependency
85
- name: pry
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - '>='
89
- - !ruby/object:Gem::Version
90
- version: '0'
82
+ requirement: &id005 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ hash: 3
88
+ segments:
89
+ - 0
90
+ version: "0"
91
91
  type: :development
92
+ version_requirements: *id005
93
+ - !ruby/object:Gem::Dependency
94
+ name: pry
92
95
  prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - '>='
96
- - !ruby/object:Gem::Version
97
- version: '0'
98
- - !ruby/object:Gem::Dependency
99
- name: rspec
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - '>='
103
- - !ruby/object:Gem::Version
104
- version: '0'
96
+ requirement: &id006 !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ hash: 3
102
+ segments:
103
+ - 0
104
+ version: "0"
105
105
  type: :development
106
+ version_requirements: *id006
107
+ - !ruby/object:Gem::Dependency
108
+ name: rspec
106
109
  prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - '>='
110
- - !ruby/object:Gem::Version
111
- version: '0'
112
- - !ruby/object:Gem::Dependency
113
- name: with_model
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - '>='
117
- - !ruby/object:Gem::Version
118
- version: '0'
110
+ requirement: &id007 !ruby/object:Gem::Requirement
111
+ none: false
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ hash: 3
116
+ segments:
117
+ - 0
118
+ version: "0"
119
119
  type: :development
120
+ version_requirements: *id007
121
+ - !ruby/object:Gem::Dependency
122
+ name: with_model
120
123
  prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - '>='
124
- - !ruby/object:Gem::Version
125
- version: '0'
126
- - !ruby/object:Gem::Dependency
127
- name: will_paginate
128
- requirement: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - '>='
131
- - !ruby/object:Gem::Version
132
- version: '0'
124
+ requirement: &id008 !ruby/object:Gem::Requirement
125
+ none: false
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ hash: 3
130
+ segments:
131
+ - 0
132
+ version: "0"
133
133
  type: :development
134
+ version_requirements: *id008
135
+ - !ruby/object:Gem::Dependency
136
+ name: will_paginate
134
137
  prerelease: false
135
- version_requirements: !ruby/object:Gem::Requirement
136
- requirements:
137
- - - '>='
138
- - !ruby/object:Gem::Version
139
- version: '0'
140
- description: PgSearch builds Active Record named scopes that take advantage of PostgreSQL's
141
- full text search
142
- email:
138
+ requirement: &id009 !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ hash: 3
144
+ segments:
145
+ - 0
146
+ version: "0"
147
+ type: :development
148
+ version_requirements: *id009
149
+ description: PgSearch builds Active Record named scopes that take advantage of PostgreSQL's full text search
150
+ email:
143
151
  - gems@nertzy.com
144
152
  - casecommons-dev@googlegroups.com
145
153
  executables: []
154
+
146
155
  extensions: []
156
+
147
157
  extra_rdoc_files: []
148
- files:
158
+
159
+ files:
149
160
  - .autotest
150
161
  - .gitignore
151
162
  - .rspec
@@ -203,31 +214,39 @@ files:
203
214
  - sql/uninstall_unnest.sql
204
215
  - sql/unnest.sql
205
216
  homepage: https://github.com/Casecommons/pg_search
206
- licenses:
217
+ licenses:
207
218
  - MIT
208
- metadata: {}
209
219
  post_install_message:
210
220
  rdoc_options: []
211
- require_paths:
221
+
222
+ require_paths:
212
223
  - lib
213
- required_ruby_version: !ruby/object:Gem::Requirement
214
- requirements:
215
- - - '>='
216
- - !ruby/object:Gem::Version
217
- version: '0'
218
- required_rubygems_version: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - '>='
221
- - !ruby/object:Gem::Version
222
- version: '0'
224
+ required_ruby_version: !ruby/object:Gem::Requirement
225
+ none: false
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ hash: 3
230
+ segments:
231
+ - 0
232
+ version: "0"
233
+ required_rubygems_version: !ruby/object:Gem::Requirement
234
+ none: false
235
+ requirements:
236
+ - - ">="
237
+ - !ruby/object:Gem::Version
238
+ hash: 3
239
+ segments:
240
+ - 0
241
+ version: "0"
223
242
  requirements: []
243
+
224
244
  rubyforge_project:
225
- rubygems_version: 2.0.3
245
+ rubygems_version: 1.8.24
226
246
  signing_key:
227
- specification_version: 4
228
- summary: PgSearch builds Active Record named scopes that take advantage of PostgreSQL's
229
- full text search
230
- test_files:
247
+ specification_version: 3
248
+ summary: PgSearch builds Active Record named scopes that take advantage of PostgreSQL's full text search
249
+ test_files:
231
250
  - spec/integration/associations_spec.rb
232
251
  - spec/integration/pagination_spec.rb
233
252
  - spec/integration/pg_search_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 002be327b000c695d0971186e1b3a2a1924f5b9f
4
- data.tar.gz: b414d034c40908cd3d8e18a64916ae72724e3d9e
5
- SHA512:
6
- metadata.gz: af2d2c1a826dd76a0157d701832a891f0e799b20bfa4dd3200444cbc3e7c280b6e342dae220997585b44f28f83bf041cf52c6aa8ef33afa9f168baf4a455bef0
7
- data.tar.gz: 8021aadff3504589004416926ca131fb1c90b4e0c6d81bcd1b8c2d67d76ec7c4ffcb64b595e7161a0dce4338baaff8195266268cc474d946514527d2e85a066e