pg_search 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1e731121eded3c8c6fc307d432507be225d61134
4
+ data.tar.gz: a19f47bb6292573ae715b2b055805a4b9992825f
5
+ SHA512:
6
+ metadata.gz: 74a646b6bcac56df197514459c42789b69f6862d14340184444cf8438b24d8847e226f4ae0d0a23e20c1409611417702e6f47a9f0c18fbcf67aa77e86bafc663
7
+ data.tar.gz: 6b546e771fe0b0c1f6970b0812d15c71c155cce162f4ccdd11c63e2f180b98e1e74d024b42f196a753b18c4c038d49ad4053effa53a11097ff5f9e8e45a53fc7
data/.travis.yml CHANGED
@@ -19,6 +19,7 @@ matrix:
19
19
  allow_failures:
20
20
  - rvm: rbx-18mode
21
21
  - rvm: rbx-19mode
22
+ - rvm: jruby-19mode
22
23
  - env: ACTIVE_RECORD_VERSION="~> 4.0.0.beta1"
23
24
  exclude:
24
25
  - rvm: 1.8.7
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,10 @@
1
1
  = PgSearch
2
2
 
3
+ == 0.6.2
4
+
5
+ * Add workaround for issue with how ActiveRecord relations handle Arel OR
6
+ nodes.
7
+
3
8
  == 0.6.1
4
9
 
5
10
  * Fix issue with Arel::InfixOperation that prevented #count from working,
@@ -36,7 +36,7 @@ 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)
39
+ Arel::Nodes::Or.new(accumulator, expression).to_sql
40
40
  end
41
41
  end
42
42
 
@@ -1,3 +1,3 @@
1
1
  module PgSearch
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
@@ -426,4 +426,45 @@ describe PgSearch do
426
426
  results.should_not include(*excluded)
427
427
  end
428
428
  end
429
+
430
+ context "chained onto a has_many association" do
431
+ with_model :Company do
432
+ model do
433
+ has_many :positions
434
+ end
435
+ end
436
+
437
+ with_model :Position do
438
+ table do |t|
439
+ t.string :title
440
+ t.belongs_to :company
441
+ end
442
+
443
+ model do
444
+ include PgSearch
445
+ pg_search_scope :search, :against => :title, :using => [:tsearch, :trigram]
446
+ end
447
+ end
448
+
449
+ # https://github.com/Casecommons/pg_search/issues/106
450
+ it "should handle numbers in a trigram query properly" do
451
+ company = Company.create!
452
+ another_company = Company.create!
453
+
454
+ included = [
455
+ Position.create!(:company_id => company.id, :title => "teller 1")
456
+ ]
457
+
458
+ excluded = [
459
+ Position.create!(:company_id => nil, :title => "teller 1"),
460
+ Position.create!(:company_id => another_company.id, :title => "teller 1"),
461
+ Position.create!(:company_id => company.id, :title => "penn 1")
462
+ ]
463
+
464
+ results = company.positions.search('teller 1')
465
+
466
+ results.should include(*included)
467
+ results.should_not include(*excluded)
468
+ end
469
+ end
429
470
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
5
- prerelease:
4
+ version: 0.6.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Grant Hutchins
@@ -10,150 +9,132 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-04-08 00:00:00.000000000 Z
12
+ date: 2013-04-20 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: activerecord
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - '>='
21
19
  - !ruby/object:Gem::Version
22
20
  version: '3.1'
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - '>='
29
26
  - !ruby/object:Gem::Version
30
27
  version: '3.1'
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: activesupport
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - '>='
37
33
  - !ruby/object:Gem::Version
38
34
  version: '3.1'
39
35
  type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - '>='
45
40
  - !ruby/object:Gem::Version
46
41
  version: '3.1'
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: arel
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>='
46
+ - - '>='
53
47
  - !ruby/object:Gem::Version
54
48
  version: '0'
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>='
53
+ - - '>='
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0'
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: rake
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
- - - ! '>='
60
+ - - '>='
69
61
  - !ruby/object:Gem::Version
70
62
  version: '0'
71
63
  type: :development
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
- - - ! '>='
67
+ - - '>='
77
68
  - !ruby/object:Gem::Version
78
69
  version: '0'
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: rdoc
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
- - - ! '>='
74
+ - - '>='
85
75
  - !ruby/object:Gem::Version
86
76
  version: '0'
87
77
  type: :development
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
- - - ! '>='
81
+ - - '>='
93
82
  - !ruby/object:Gem::Version
94
83
  version: '0'
95
84
  - !ruby/object:Gem::Dependency
96
85
  name: pry
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
- - - ! '>='
88
+ - - '>='
101
89
  - !ruby/object:Gem::Version
102
90
  version: '0'
103
91
  type: :development
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
- - - ! '>='
95
+ - - '>='
109
96
  - !ruby/object:Gem::Version
110
97
  version: '0'
111
98
  - !ruby/object:Gem::Dependency
112
99
  name: rspec
113
100
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
101
  requirements:
116
- - - ! '>='
102
+ - - '>='
117
103
  - !ruby/object:Gem::Version
118
104
  version: '0'
119
105
  type: :development
120
106
  prerelease: false
121
107
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
108
  requirements:
124
- - - ! '>='
109
+ - - '>='
125
110
  - !ruby/object:Gem::Version
126
111
  version: '0'
127
112
  - !ruby/object:Gem::Dependency
128
113
  name: with_model
129
114
  requirement: !ruby/object:Gem::Requirement
130
- none: false
131
115
  requirements:
132
- - - ! '>='
116
+ - - '>='
133
117
  - !ruby/object:Gem::Version
134
118
  version: '0'
135
119
  type: :development
136
120
  prerelease: false
137
121
  version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
122
  requirements:
140
- - - ! '>='
123
+ - - '>='
141
124
  - !ruby/object:Gem::Version
142
125
  version: '0'
143
126
  - !ruby/object:Gem::Dependency
144
127
  name: will_paginate
145
128
  requirement: !ruby/object:Gem::Requirement
146
- none: false
147
129
  requirements:
148
- - - ! '>='
130
+ - - '>='
149
131
  - !ruby/object:Gem::Version
150
132
  version: '0'
151
133
  type: :development
152
134
  prerelease: false
153
135
  version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
136
  requirements:
156
- - - ! '>='
137
+ - - '>='
157
138
  - !ruby/object:Gem::Version
158
139
  version: '0'
159
140
  description: PgSearch builds Active Record named scopes that take advantage of PostgreSQL's
@@ -224,27 +205,26 @@ files:
224
205
  homepage: https://github.com/Casecommons/pg_search
225
206
  licenses:
226
207
  - MIT
208
+ metadata: {}
227
209
  post_install_message:
228
210
  rdoc_options: []
229
211
  require_paths:
230
212
  - lib
231
213
  required_ruby_version: !ruby/object:Gem::Requirement
232
- none: false
233
214
  requirements:
234
- - - ! '>='
215
+ - - '>='
235
216
  - !ruby/object:Gem::Version
236
217
  version: '0'
237
218
  required_rubygems_version: !ruby/object:Gem::Requirement
238
- none: false
239
219
  requirements:
240
- - - ! '>='
220
+ - - '>='
241
221
  - !ruby/object:Gem::Version
242
222
  version: '0'
243
223
  requirements: []
244
224
  rubyforge_project:
245
- rubygems_version: 1.8.25
225
+ rubygems_version: 2.0.0
246
226
  signing_key:
247
- specification_version: 3
227
+ specification_version: 4
248
228
  summary: PgSearch builds Active Record named scopes that take advantage of PostgreSQL's
249
229
  full text search
250
230
  test_files: