dusen 0.4.8 → 0.4.9

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 1.8.7
data/README.md CHANGED
@@ -130,6 +130,16 @@ Note that you can combine text tokens and field tokens:
130
130
 
131
131
  > Contact.search('fooville email:foo@bar.com')
132
132
  => Contact.where_like(columns => 'fooville').where(:email => 'foo@bar.com')
133
+
134
+ ### Caveat
135
+
136
+ If you search for a phrase containing a colon (e.g. `deploy:rollback`), Dusen
137
+ will mistake the first part as a – nonexistent – qualifier and return an empty
138
+ set.
139
+
140
+ To prevent that, prefix your query with the default qualifier `text`:
141
+
142
+ text:deploy:rollback
133
143
 
134
144
 
135
145
  Processing full text queries with FULLTEXT indexes
data/Rakefile CHANGED
@@ -45,7 +45,7 @@ namespace :all do
45
45
  desc "Bundle all spec apps"
46
46
  task :bundle do
47
47
  for_each_directory_of('spec/**/Gemfile') do |directory|
48
- system("cd #{directory} Gemfile.lock && bundle install")
48
+ system("cd #{directory} && bundle install")
49
49
  end
50
50
  end
51
51
 
data/lib/dusen/syntax.rb CHANGED
@@ -38,7 +38,13 @@ module Dusen
38
38
  private
39
39
 
40
40
  DEFAULT_UNKNOWN_SCOPER = lambda do |scope, *args|
41
- scope.where('1=2')
41
+ if scope.respond_to?(:where)
42
+ # Rails 3
43
+ scope.where('1=2')
44
+ else
45
+ # Rails 2
46
+ scope.scoped(:conditions => ['1=2'])
47
+ end
42
48
  end
43
49
 
44
50
  def unknown_scoper
data/lib/dusen/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Dusen
4
- VERSION = '0.4.8'
4
+ VERSION = '0.4.9'
5
5
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- dusen (0.4.7)
4
+ dusen (0.4.9)
5
5
  activerecord
6
6
  edge_rider (>= 0.2.3)
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- dusen (0.4.7)
4
+ dusen (0.4.9)
5
5
  activerecord
6
6
  edge_rider (>= 0.2.3)
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- dusen (0.4.7)
4
+ dusen (0.4.9)
5
5
  activerecord
6
6
  edge_rider (>= 0.2.3)
7
7
 
@@ -38,6 +38,11 @@ shared_examples_for 'model with search syntax' do
38
38
  subject.search('email:foo@bar.com').to_a.should == [match]
39
39
  end
40
40
 
41
+ it 'should find no records if a nonexistent qualifier is used' do
42
+ subject.create!(:name => 'someuser', :email => 'foo@bar.com')
43
+ subject.search('nonexistent_qualifier:someuser email:foo@bar.com').to_a.should == []
44
+ end
45
+
41
46
  it 'should allow phrases as values for qualified field queries' do
42
47
  match = subject.create!(:name => 'Foo Bar', :city => 'Foo Bar')
43
48
  no_match = subject.create!(:name => 'Foo Bar', :city => 'Bar Foo')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dusen
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 8
10
- version: 0.4.8
9
+ - 9
10
+ version: 0.4.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Henning Koch
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-09-17 00:00:00 +02:00
18
+ date: 2014-01-24 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -58,7 +58,7 @@ extra_rdoc_files: []
58
58
 
59
59
  files:
60
60
  - .gitignore
61
- - .rvmrc
61
+ - .ruby-version
62
62
  - .travis.yml
63
63
  - LICENSE
64
64
  - README.md
data/.rvmrc DELETED
@@ -1,2 +0,0 @@
1
- rvm 1.8.7
2
-